<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><script>(()=>{const e=navigator.serviceWorker;e?e.register("/sw.js").then((async e=>{console.log("SWPP 注册成功");try{await e.periodicSync.register("update",{minInterval:864e5})}catch(e){console.log("Periodic Sync 注册失败",e)}})).catch((e=>console.error("SWPP 注册失败",e))):console.warn("当前浏览器不支持 SW")})()</script><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><title>从Memos转移到Moments | LiuShen's Blog</title><meta name="author" content="LiuShen"><meta name="copyright" content="LiuShen"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="robots" content="index, follow"><meta name="description" content="由于Memos作者频繁的更新API，一直想替换掉它，最终找到了替代程序Moments。虽然功能不如Memos丰富，但对于我这种把Memos当做说说使用的用户，Moments的功能更加实用。更重要的是，它的API简单易懂，数据更为实用，作者也非常听取用户反馈，积极改善产品。"><meta property="og:type" content="article"><meta property="og:title" content="从Memos转移到Moments"><meta property="og:url" content="https://blog.liushen.fun/posts/8338183a/"><meta property="og:site_name" content="LiuShen's Blog"><meta property="og:description" content="由于Memos作者频繁的更新API，一直想替换掉它，最终找到了替代程序Moments。虽然功能不如Memos丰富，但对于我这种把Memos当做说说使用的用户，Moments的功能更加实用。更重要的是，它的API简单易懂，数据更为实用，作者也非常听取用户反馈，积极改善产品。"><meta property="og:locale" content="zh_CN"><meta property="og:image" content="https://p.liiiu.cn/i/2025/02/18/67b40d14e9390.webp"><meta property="article:published_time" content="2025-02-18T13:14:00.000Z"><meta property="article:modified_time" content="2025-03-20T08:05:00.000Z"><meta property="article:author" content="LiuShen"><meta property="article:tag" content="说说"><meta property="article:tag" content="Memos"><meta property="article:tag" content="Moments"><meta property="article:tag" content="Butterfly"><meta name="twitter:card" content="summary"><meta name="twitter:image" content="https://p.liiiu.cn/i/2025/02/18/67b40d14e9390.webp"><link rel="shortcut icon" href="/favicon.ico"><link rel="canonical" href="https://blog.liushen.fun/posts/8338183a/"><link rel="preconnect" href="https://jsd.liiiu.cn"><meta name="baidu-site-verification" content="codeva-i2bF9bXDJs"><meta name="sogou_site_verification" content="1rIjtK6RhE"><meta name="360-site-verification" content="b9a9f96ae38a1932a326f8ba255cc74b"><meta name="msvalidate.01" content="F7C246820EB04DD140494C98F93A97C7"><meta name="google-site-verification" content="VH3ZE6m42MZDqpTY2tD-XoxDt9iUj2HoiC3W2neB7F4"><link rel="manifest" href="/manifest.json"><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/config/img/pwa/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/config/img/pwa/favicon-16x16.png"><link rel="mask-icon" href="/config/img/pwa/favicon-mask.svg" color="#5bbad5"><link rel="stylesheet" href="/css/index.css?v=5.0.0"><link rel="stylesheet" href="/css/custom.css?v=5.0.0"><link rel="stylesheet" href="https://jsd.liiiu.cn/npm/@fortawesome/fontawesome-free@6.7.2/css/all.min.css"><link rel="stylesheet" href="https://jsd.liiiu.cn/npm/@fancyapps/ui@5.0.36/dist/fancybox/fancybox.min.css" media="print" onload='this.media="all"'><script>(()=>{const e={set:(e,t,o)=>{if(!o)return;const n=Date.now()+864e5*o;localStorage.setItem(e,JSON.stringify({value:t,expiry:n}))},get:e=>{const t=localStorage.getItem(e);if(!t)return;const{value:o,expiry:n}=JSON.parse(t);if(!(Date.now()>n))return o;localStorage.removeItem(e)}};window.btf={saveToLocal:e,getScript:(e,t={})=>new Promise(((o,n)=>{const a=document.createElement("script");a.src=e,a.async=!0,Object.entries(t).forEach((([e,t])=>a.setAttribute(e,t))),a.onload=a.onreadystatechange=()=>{a.readyState&&!/loaded|complete/.test(a.readyState)||o()},a.onerror=n,document.head.appendChild(a)})),getCSS:(e,t)=>new Promise(((o,n)=>{const a=document.createElement("link");a.rel="stylesheet",a.href=e,t&&(a.id=t),a.onload=a.onreadystatechange=()=>{a.readyState&&!/loaded|complete/.test(a.readyState)||o()},a.onerror=n,document.head.appendChild(a)})),addGlobalFn:(e,t,o=!1,n=window)=>{const a=n.globalFn||{};a[e]=a[e]||{},o&&a[e][o]||(a[e][o||Object.keys(a[e]).length]=t,n.globalFn=a)}};const t=()=>{document.documentElement.setAttribute("data-theme","dark"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#0d0d0d")},o=()=>{document.documentElement.setAttribute("data-theme","light"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#ffffff")};btf.activateDarkMode=t,btf.activateLightMode=o;const n=e.get("theme"),a=(new Date).getHours();void 0===n?a<=6||a>=18?t():o():"light"===n?o():t();const r=e.get("aside-status");void 0!==r&&document.documentElement.classList.toggle("hide-aside","hide"===r);/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)&&document.documentElement.classList.add("apple")})()</script><script>const GLOBAL_CONFIG={root:"/",algolia:{appId:"7IX3UBC6JW",apiKey:"4ac2846352e499675081f1277fb961c1",indexName:"My Blog",hitsPerPage:6,languages:{input_placeholder:"搜索全站文章",hits_empty:"未找到符合您查询的内容：${query}",hits_stats:"找到 ${hits} 条结果，耗时 ${time} 毫秒"}},localSearch:void 0,translate:{defaultEncoding:2,translateDelay:0,msgToTraditionalChinese:"繁",msgToSimplifiedChinese:"簡"},noticeOutdate:{limitDay:365,position:"top",messagePrev:"本篇文章从发布到现在已经隔了",messageNext:"天了，里面的内容可能过期了，你要自己甄别一下哟👉👈"},highlight:{plugin:"highlight.js",highlightCopy:!0,highlightLang:!0,highlightHeightLimit:400,highlightFullpage:!1,highlightMacStyle:!0},copy:{success:"😋复制啦！请注意版权信息呀！",error:"😪呜呜，复制失败了！",noSupport:"🤐浏览器不支持呢，你用的啥玩意？"},relativeDate:{homepage:!1,post:!1},runtime:"天",dateSuffix:{just:"刚刚",min:"分钟前",hour:"小时前",day:"天前",month:"个月前"},copyright:{limitCount:1e3,languages:{author:"作者: LiuShen",link:"链接: ",source:"来源: LiuShen's Blog",info:"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},lightbox:"fancybox",Snackbar:{chs_to_cht:"已切换为繁体中文",cht_to_chs:"已切换为简体中文",day_to_night:"已切换为深色模式",night_to_day:"已切换为浅色模式",bgLight:"rgba(255, 255, 255, 0.509)",bgDark:"rgba(48, 48, 48, 0.509)",position:"top-right"},infinitegrid:{js:"https://jsd.liiiu.cn/npm/@egjs/infinitegrid@4.12.0/dist/infinitegrid.min.js",buttonText:"加载更多"},isPhotoFigcaption:!0,islazyload:!0,isAnchor:!1,percent:{toc:!0,rightside:!1},autoDarkmode:!1}</script><script id="config-diff">var GLOBAL_CONFIG_SITE={title:"从Memos转移到Moments",isPost:!0,isHome:!1,isHighlightShrink:void 0,isToc:!0,postUpdate:"2025-03-20 16:05:00"}</script><link rel="stylesheet" href="https://jsd.liiiu.cn/gh/willow-god/Sharding-fonts/Yozai-Medium/result.min.css"><link rel="stylesheet" href="/config/memos/memos.css"><script defer src="/sw-dom.js"></script><link rel="stylesheet" href="https://jsd.liiiu.cn/npm/swiper@11.1.14/swiper-bundle.min.css" media="print" onload='this.media="all"'><link rel="stylesheet" href="/config/swiper/swiperstyle.css" media="print" onload='this.media="all"'><meta name="generator" content="Hexo 7.3.0"><link rel="alternate" href="/atom.xml" title="LiuShen's Blog" type="application/atom+xml"></head><body><div class="float-box right top"></div><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><img class="load-image" src="" data-lazy-src="/config/img/preloader.gif" alt=""></div><script async>(()=>{const e=document.getElementById("loading-box"),d=document.body,t=()=>{d.style.overflow="",e.classList.add("loaded")},n=()=>{d.style.overflow="hidden",e.classList.remove("loaded")};n();let o=!1;window.addEventListener("load",(()=>{o||(t(),o=!0)})),setTimeout((()=>{o||(t(),o=!0)}),5e3),window.addEventListener("load",(()=>{t()})),setTimeout((function(){t()}),3e3),document.getElementById("loading-box").addEventListener("click",(()=>{t()})),document.addEventListener("pjax:send",(()=>{n()})),document.addEventListener("pjax:complete",(()=>{t()}))})()</script><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="add-menu-container"><div id="travellings"><a class="site-page" href="https://www.travellings.cn/go.html" title="友链接力-随机开往" target="_blank" rel="noopener nofollow"><i class="fa-solid fa-bus fa-fw"></i></a></div><div id="ten-years"><a class="site-page" href="https://foreverblog.cn/go.html" title="友链接力-十年之约" target="_blank" rel="noopener nofollow"><i class="fa-brands fa-nfc-symbol fa-fw"></i></a></div></div><div class="is-center" id="sidebar-avatar"><div class="avatar-img is-center"><img class="mood-icon" src="" data-lazy-src="https://p.liiiu.cn/i/2025/03/14/67d301461a24a.webp" alt="🤤" onerror='this.onerror=null,this.src="/img/friend_404.gif"'><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/03/13/67d2fc82d329c.webp" onerror='this.onerror=null,this.src="/img/friend_404.gif"' alt="avatar"></div><div class="author-info__name">LiuShen</div></div><div class="site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">72</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">98</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">3</div></a></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/willow-god"><i class="fab fa-github"></i><span>Follow Me 🛫</span></a><div class="menus_items visible"><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fas fa-home"></i> <span>导航</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="https://www.liushen.fun/"><i class="fa-fw fa-solid fa-house-flag"></i> <span>个人主页</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://xc.liushen.fun/"><i class="fa-fw fa fa-camera-retro"></i> <span>个人相册</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa fa-graduation-cap"></i> <span>整理</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i> <span>时光卷轴</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i> <span>文章标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i> <span>文章分类</span></a></li><li><a class="site-page child" href="/charts/"><i class="fa-fw fa-solid fa-chart-pie"></i> <span>文章通览</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa-solid fa-user-group"></i> <span>友人</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/link/"><i class="fa-fw fas fa-link"></i> <span>友链展示</span></a></li><li><a class="site-page child" href="/addlink/"><i class="fa-fw fa fa-at"></i> <span>友链申请</span></a></li><li><a class="site-page child" href="/fcircle/"><i class="fa-fw fa-solid fa-circle-nodes"></i> <span>朋友动态</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa fa-paper-plane"></i> <span>留言</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/comment/"><i class="fa-fw fa-solid fa-chalkboard"></i> <span>留言白板</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://mm.liushen.fun/"><i class="fa-fw fa-solid fa-pen-nib"></i> <span>提笔摘星</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa-solid fa-stethoscope"></i> <span>分享</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="https://gist.liushen.fun/"><i class="fa-fw fa-solid fa-code"></i> <span>代码片段</span></a></li><li><a class="site-page child" href="/subscribe/"><i class="fa-fw fa-solid fa-rss"></i> <span>订阅本站</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://pan.liushen.fun/"><i class="fa-fw fa-solid fa-laptop-file"></i> <span>清羽云盘</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa fa-list"></i> <span>关于</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/about/"><i class="fa-fw fa fa-address-card"></i> <span>站长资料</span></a></li><li><a class="site-page child" href="/shuoshuo/"><i class="fa-fw fa fa-commenting"></i> <span>日常说说</span></a></li><li><a class="site-page child" href="/devices/"><i class="fa-fw fa-solid fa-tachograph-digital"></i> <span>我的设备</span></a></li></ul></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg fixed" id="page-header" style="background-image:url(https://p.liiiu.cn/i/2025/02/18/67b40d14e9390.webp)"><nav id="nav"><div class="more-app-btn"><i class="fa-solid fa-fingerprint fa-fw"></i><div class="more-app-list-groups"><div class="more-app-list-groups-container"><div class="more-app-list-group"><div class="more-app-list-title">🦄常用网站</div><div class="more-app-list"><a class="more-app-list-item" href="https://www.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-house"></i><span class="more-app-item-text">个人主页</span></a><a class="more-app-list-item" href="https://blog.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-blog"></i><span class="more-app-item-text">个人博客</span></a><a class="more-app-list-item" href="https://xc.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-image"></i><span class="more-app-item-text">个人相册</span></a><a class="more-app-list-item" href="https://github.com/willow-god" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-brands fa-github"></i><span class="more-app-item-text">Github</span></a></div></div><div class="more-app-list-group"><div class="more-app-list-title">😎周边站点</div><div class="more-app-list"><a class="more-app-list-item" href="https://gist.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-code"></i><span class="more-app-item-text">代码片段</span></a><a class="more-app-list-item" href="https://mm.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-pen-nib"></i><span class="more-app-item-text">提笔摘星</span></a><a class="more-app-list-item" href="https://pan.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-cloud"></i><span class="more-app-item-text">清羽云盘</span></a><a class="more-app-list-item" href="https://um.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-people-group"></i><span class="more-app-item-text">访客统计</span></a><a class="more-app-list-item" href="https://img.liiiu.cn/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-images"></i><span class="more-app-item-text">清羽图床</span></a><a class="more-app-list-item" href="https://chat.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-robot"></i><span class="more-app-item-text">清羽AI</span></a><a class="more-app-list-item" href="https://bsz.liiiu.cn/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-chart-pie"></i><span class="more-app-item-text">不蒜计数</span></a><a class="more-app-list-item" href="https://status.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-server"></i><span class="more-app-item-text">服务检测</span></a></div></div><div class="more-app-list-group"><div class="more-app-list-title">🚁实用工具</div><div class="more-app-list"><a class="more-app-list-item" href="https://tmail.qyliu.top/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-envelope"></i><span class="more-app-item-text">临时邮箱</span></a><a class="more-app-list-item" href="https://hot.liushen.fun/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-fire"></i><span class="more-app-item-text">每日热榜</span></a><a class="more-app-list-item" href="https://cover.qyliu.top/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-eye"></i><span class="more-app-item-text">封面设计</span></a><a class="more-app-list-item" href="https://mini-cover.qyliu.top/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-image"></i><span class="more-app-item-text">迷你封面</span></a><a class="more-app-list-item" href="https://icon.qyliu.top/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-icons"></i><span class="more-app-item-text">万能图标</span></a><a class="more-app-list-item" href="https://draw.qyliu.top/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-paintbrush"></i><span class="more-app-item-text">灵感白板</span></a><a class="more-app-list-item" href="https://mindmap.qyliu.top/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-network-wired"></i><span class="more-app-item-text">思维导图</span></a><a class="more-app-list-item" href="https://share.liushen.fun/#/" rel="nofollow noopener" target="_blank"><i class="more-app-item-icon fa-solid fa-share-nodes"></i><span class="more-app-item-text">内容中转</span></a></div></div></div></div></div><span id="blog-info"><a class="nav-site-title" href="/" title="LiuShen's Blog"><span class="site-name">LiuShen</span></a></span><div id="menus"></div><div class="menus_items visible"><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fas fa-home"></i> <span>导航</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="https://www.liushen.fun/"><i class="fa-fw fa-solid fa-house-flag"></i> <span>个人主页</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://xc.liushen.fun/"><i class="fa-fw fa fa-camera-retro"></i> <span>个人相册</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa fa-graduation-cap"></i> <span>整理</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i> <span>时光卷轴</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i> <span>文章标签</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i> <span>文章分类</span></a></li><li><a class="site-page child" href="/charts/"><i class="fa-fw fa-solid fa-chart-pie"></i> <span>文章通览</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa-solid fa-user-group"></i> <span>友人</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/link/"><i class="fa-fw fas fa-link"></i> <span>友链展示</span></a></li><li><a class="site-page child" href="/addlink/"><i class="fa-fw fa fa-at"></i> <span>友链申请</span></a></li><li><a class="site-page child" href="/fcircle/"><i class="fa-fw fa-solid fa-circle-nodes"></i> <span>朋友动态</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa fa-paper-plane"></i> <span>留言</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/comment/"><i class="fa-fw fa-solid fa-chalkboard"></i> <span>留言白板</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://mm.liushen.fun/"><i class="fa-fw fa-solid fa-pen-nib"></i> <span>提笔摘星</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa-solid fa-stethoscope"></i> <span>分享</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" target="_blank" rel="noopener" href="https://gist.liushen.fun/"><i class="fa-fw fa-solid fa-code"></i> <span>代码片段</span></a></li><li><a class="site-page child" href="/subscribe/"><i class="fa-fw fa-solid fa-rss"></i> <span>订阅本站</span></a></li><li><a class="site-page child" target="_blank" rel="noopener" href="https://pan.liushen.fun/"><i class="fa-fw fa-solid fa-laptop-file"></i> <span>清羽云盘</span></a></li></ul></div><div class="menus_item"><span class="site-page group hide"><i class="fa-fw fa fa-list"></i> <span>关于</span><i class="fas fa-chevron-down"></i></span><ul class="menus_item_child"><li><a class="site-page child" href="/about/"><i class="fa-fw fa fa-address-card"></i> <span>站长资料</span></a></li><li><a class="site-page child" href="/shuoshuo/"><i class="fa-fw fa fa-commenting"></i> <span>日常说说</span></a></li><li><a class="site-page child" href="/devices/"><i class="fa-fw fa-solid fa-tachograph-digital"></i> <span>我的设备</span></a></li></ul></div></div><center id="name-container"><a id="page-name" href="javascript:btf.scrollToDest(0, 500)">PAGE_NAME</a></center><div id="nav-right"><div id="travellings"><a class="site-page" href="https://www.travellings.cn/go.html" title="友链接力-随机开往" target="_blank" rel="noopener nofollow"><i class="fa-solid fa-bus fa-fw"></i></a></div><div id="ten-years"><a class="site-page" href="https://foreverblog.cn/go.html" title="友链接力-十年之约" target="_blank" rel="noopener nofollow"><i class="fa-brands fa-nfc-symbol fa-fw"></i></a></div><div id="random"><a class="site-page" href="javascript:randomPost()" title="随机前往一个文章"><i class="fa-solid fa-shuffle fa-fw"></i></a></div><div id="search-button"><span class="site-page social-icon search"><i class="fas fa-search fa-fw"></i></span></div><div id="toggle-menu"><span class="site-page" href="javascript:void(0);" title="展开菜单"><i class="fas fa-indent fa-fw"></i></span></div></div></nav><div id="post-info"><h1 class="post-title">从Memos转移到Moments</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2025-02-18T13:14:00.000Z" title="发表于 2025-02-18 21:14:00">2025-02-18</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2025-03-20T08:05:00.000Z" title="更新于 2025-03-20 16:05:00">2025-03-20</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/website/">博客管理</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">总字数:</span><span class="word-count">10k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>47分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" data-flag-title=""><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">浏览量:</span><span id="busuanzi_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span><span class="post-meta-separator">|</span><span class="post-meta-commentcount"><i class="far fa-comments fa-fw post-meta-icon"></i><span class="post-meta-label">评论数:</span><a href="/posts/8338183a/#post-comment"><span id="ArtalkCount"><i class="fa-solid fa-spinner fa-spin"></i></span></a></span></div></div></div><section class="main-hero-waves-area waves-area"><svg class="waves-svg" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s58 18 88 18 58-18 88-18 58 18 88 18v44h-352Z"></path></defs><g class="parallax"><use href="#gentle-wave" x="48" y="0"></use><use href="#gentle-wave" x="48" y="3"></use><use href="#gentle-wave" x="48" y="5"></use><use href="#gentle-wave" x="48" y="7"></use></g></svg></section></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><div class="ai-summary"><div class="ai-head"><div class="ai-head-left"><div class="ai-circle ai-circle-1"></div><div class="ai-circle ai-circle-2"></div><div class="ai-circle ai-circle-3"></div></div><div class="ai-head-right"><a class="ai-about-ai" href="/posts/40702a0d/">关于AI</a></div></div><div class="ai-explanation" style="display:block" data-summary="这里是清羽AI，这篇文章介绍了从Memos转移到Moments的过程，Memos是一款受欢迎的备忘录应用，但由于API多次更新和数据库不可逆的问题，作者决定寻找替代品。Moments是一个轻量朋友圈项目，早期基于PHP，后来改为Golang，功能更强，内存占用更低。文章详细介绍了Moments的部署教程，包括Compose部署和Nginx修改，以及前端实现说说页面和轻量朋友圈的方法。Moments支持分享链接、图片、音乐、视频、书籍、电影等功能，并提供了自定义位置、标签、公开性等设置，同时支持Markdown渲染、编辑、删除说说、暗夜模式、自定义图标、信息、CSS及JS代码等功能。作者还分享了如何在前端展示Moments的数据，包括引入MetingJS和APlayer包，以及创建说说页面和JS文件。整体上，Moments是一个功能丰富、轻量级的朋友圈应用，适合替代Memos。">清羽AI正在绞尽脑汁想思路ING···</div><div class="ai-title"><div class="ai-title-left"><i class="fa-brands fa-slack"></i><div class="ai-title-text">清羽のAI摘要</div></div><div class="ai-tag" id="ai-tag">GLM-4-Flash</div></div></div><h2 id="碎碎念"><a href="#碎碎念" class="headerlink" title="碎碎念"></a>碎碎念</h2><div class="note note-warning"><div class="note-header"><i class="note-icon fa-regular fa-circle-dot"></i> <span class="note-title">问题说明</span></div><div class="note-content"><p>仅有版本<code>0.2.8</code>及以前没有跨域功能，最新版本已经更新，请按照官方文档配置防止跨域即可，无需在<code>nginx</code>端进行设置了。</p></div></div><p><code>Memos</code>是一款很受欢迎的备忘录应用，可以在服务器中利用<code>Docker</code>便捷的部署，可以在线发布说说，备忘录，并且可以利用<code>API</code>展示到前端，功能上很强大，但是由于<code>API</code>的多次更新，很难做到及时兼容，再加上每次升级后数据库都不可逆，很容易造成不可挽回的后果，给作者提建议作者似乎也有自己的想法，并不遵从大众的意见，于是只能继续使用旧版本，并且一直在找替代品。</p><p>在这期间，我找到了一些也很优秀的产品，比如<a target="_blank" rel="external nofollow noopener noreferrer" href="/safego/?u=aHR0cHM6Ly9naXRodWIuY29tL2plcnJ5c2hlbGwvbXktZmxvbW8tc2VydmVy">My-flomo-server</a>，<a target="_blank" rel="external nofollow noopener noreferrer" href="/safego/?u=aHR0cHM6Ly9naXRodWIuY29tL29wZW5uZW5vL25lbm8">Nano</a>，<a target="_blank" rel="external nofollow noopener noreferrer" href="/safego/?u=aHR0cHM6Ly9naXRodWIuY29tL2JsaW5rby1zcGFjZS9ibGlua28">blinko</a>等等，但是都因为各种原因，如内存占用，部署环境，数据存储等原因，无法再我的环境上使用，不得不说<code>Memos</code>这个产品本身确实很优秀，由于是<code>Golang</code>开发的，后端很轻，内存占用仅有<code>30MB</code>左右，而市面上很多同类型产品都是基于<code>SpringBoot</code>开发，在内存方面，<code>Java</code>的占用众所周知。</p><p>但是我也并不着急，毕竟<code>Memos-0.21.0</code>版本目前还是很适合我的，于是我也在慢慢找，在这个期间，我注意到了一个项目，<code>Moments</code>，这个项目的早期版本是基于<strong>世界上最好的语言：</strong><code>PHP</code>，从<code>2.1.0</code>开始，作者听从社区的意见，修改成了<code>Golang</code>，内存大幅减小，功能性也更强，迭代到现在，基本功能已经实现，比如插入视频，豆瓣读书和电影，分享链接，分享音乐，分享图片，在<code>Memos</code>中我需要自定义这些，比如使用<code>{bilibili 视频ID}</code>，但是在<code>Moments</code>，这些视频和音乐都有很完善的接口，返回数据也很直观，十分适合直接调用，于是我毫不犹豫的换了过来，最终实现了我很满意的效果。</p><div class="liushen-tag-link"><a class="tag-Link" target="_blank" href="/safego/?u=aHR0cHM6Ly9naXRodWIuY29tL2tpbmd3cmN5L21vbWVudHM" rel="external nofollow noopener noreferrer"><div class="tag-link-tips">🙄引用站外地址，不保证站点的可用性和安全性</div><div class="tag-link-bottom"><div class="tag-link-left" style="background-image:url(https://p.liiiu.cn/i/2024/07/27/66a461a3098aa.webp)"></div><div class="tag-link-right"><div class="tag-link-title">🌟 Moments - 极简朋友圈</div><div class="tag-link-sitename">github.com@kingwrcy</div></div><i class="fa-solid fa-angle-right"></i></div></a></div><p>这篇文章就给大家介绍一下我的修改方案，方便大家抄作业，顺便给也想要换掉<code>Memos</code>的朋友提供一条新路。</p><h2 id="前期要求"><a href="#前期要求" class="headerlink" title="前期要求"></a>前期要求</h2><h3 id="硬件要求"><a href="#硬件要求" class="headerlink" title="硬件要求"></a>硬件要求</h3><ul><li>一台服务器</li><li>一个可自主解析的域名</li></ul><h3 id="软件要求"><a href="#软件要求" class="headerlink" title="软件要求"></a>软件要求</h3><ul><li><code>docker</code>环境</li><li>反向代理工具（本文以<code>Nginx</code>为例）</li></ul><h2 id="介绍与展示"><a href="#介绍与展示" class="headerlink" title="介绍与展示"></a>介绍与展示</h2><p>这里先给大家展示一下最终的效果，注意该教程可能仅适合部分主题，如果出现主题不适配的情况请自行适配，这里以本站主题<code>Hexo-theme-butterfly</code>为基础进行修改：</p><ol><li><p>说说页面：</p><div class="liushen-tag-link"><a class="tag-Link" target="_blank" href="https://blog.liushen.fun/shuoshuo/"><div class="tag-link-tips">😃来自本站，本站可确保其安全性，请放心点击跳转</div><div class="tag-link-bottom"><div class="tag-link-left" style="background-image:url(https://p.liiiu.cn/i/2024/08/01/66aae601dbc9b.webp)"></div><div class="tag-link-right"><div class="tag-link-title">清羽飞扬の日常说说</div><div class="tag-link-sitename">LiuShen's Blog</div></div><i class="fa-solid fa-angle-right"></i></div></a></div><p>由于前端才是最主要的展示区域，在这里我尽可能做了最多的适配，适配了豆瓣阅读书籍卡片分享，豆瓣电影分享，图片分享，链接分享，音乐分享，<code>Bilibili</code>分享，<code>Youtube</code>分享，黑夜模式等多种适配，这里仅展示部分功能，其中<code>bilibili</code>视频因为目前官方版本有问题，无法添加，<code>yoputube</code>由于拉低网络加载速度，不予展示。其他的具体效果可以上网站我的说说页面自行查看。</p><div class="tabs"><div class="nav-tabs"><button type="button" class="tab active">亮色模式</button><button type="button" class="tab">暗色模式</button><button type="button" class="tab">书籍分享</button><button type="button" class="tab">电影分享</button><button type="button" class="tab">音乐分享</button><button type="button" class="tab">图片分享</button><button type="button" class="tab">链接分享</button></div><div class="tab-contents"><div class="tab-item-content active"><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/02/18/67b421ba6c89b.webp" alt="亮色模式"></p></div><div class="tab-item-content"><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/02/18/67b421e2ecb4f.webp" alt="暗色模式"></p></div><div class="tab-item-content"><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/02/18/67b422322a60b.webp" alt="书籍分享"></p></div><div class="tab-item-content"><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/02/18/67b422625ad5b.webp" alt="电影分享"></p></div><div class="tab-item-content"><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/02/18/67b42280d44eb.webp" alt="音乐分享"></p></div><div class="tab-item-content"><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/02/18/67b4229d92bb8.webp" alt="图片分享"></p></div><div class="tab-item-content"><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/02/18/67b422b877dfe.webp" alt="链接分享"></p></div></div><div class="tab-to-top"><button type="button" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div></div></li><li><p>轻量朋友圈</p><div class="liushen-tag-link"><a class="tag-Link" target="_blank" href="https://mm.liushen.fun/"><div class="tag-link-tips">😃来自本站，本站可确保其安全性，请放心点击跳转</div><div class="tag-link-bottom"><div class="tag-link-left" style="background-image:url(https://p.liiiu.cn/i/2024/08/01/66aae601dbc9b.webp)"></div><div class="tag-link-right"><div class="tag-link-title">清羽飞扬の轻量朋友圈</div><div class="tag-link-sitename">LiuShen's Blog</div></div><i class="fa-solid fa-angle-right"></i></div></a></div><p>这里也没什么过多可以展示的，因为网站功能太多，无法一一展示，建议大家直接进入网站自行查看。</p><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/02/18/67b42335c02fe.webp" alt="轻量朋友圈"></p></li><li><p>功能说明</p><p><code>Moments</code>作为一个轻量朋友圈，其功能都是分享上的部分，如下所示：</p><ul><li>分享：链接，图片，音乐，视频，书籍，电影</li><li>信息：自定义位置，自定义标签，是否公开</li><li>页面：<code>Markdown</code>渲染，编辑说说，删除说说，暗夜模式，自定义图标，信息，<code>CSS</code>及<code>JS</code>代码</li><li>功能：<code>S3</code>存储，文件查询，多用户注册，点赞，评论，<code>API</code></li></ul></li></ol><p>简单介绍完毕，下面我就来教大家如何进行部署！</p><h2 id="部署教程"><a href="#部署教程" class="headerlink" title="部署教程"></a>部署教程</h2><h3 id="Moments部署"><a href="#Moments部署" class="headerlink" title="Moments部署"></a>Moments部署</h3><h4 id="Compose部署"><a href="#Compose部署" class="headerlink" title="Compose部署"></a>Compose部署</h4><p>官方给予了很完善的教程，这里我仅仅简单介绍一下<code>docker-compose</code>部署的方式，如果你想以源码等其他方式进行部署，请查看文章开头部分的<code>github</code>地址进行查阅。</p><p>首先，在服务器任意位置创建文件：<code>docker-compose.yaml</code>，填入以下内容：</p><figure class="highlight yaml"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">version:</span> <span class="string">'3'</span></span><br><span class="line"><span class="attr">services:</span></span><br><span class="line">  <span class="attr">moments:</span></span><br><span class="line">    <span class="attr">image:</span> <span class="string">kingwrcy/moments:latest</span></span><br><span class="line">    <span class="attr">container_name:</span> <span class="string">moments</span></span><br><span class="line">    <span class="attr">restart:</span> <span class="string">always</span></span><br><span class="line">    <span class="attr">environment:</span></span><br><span class="line">      <span class="attr">port:</span> <span class="number">3000</span></span><br><span class="line">      <span class="attr">JWT_KEY:</span> <span class="string">"自己随便生成点字符串"</span></span><br><span class="line">      <span class="attr">ENABLE_SWAGGER:</span> <span class="string">"true"</span></span><br><span class="line">    <span class="attr">ports:</span></span><br><span class="line">      <span class="bullet">-</span> <span class="string">"3003:3000"</span>  <span class="comment"># 自行换端口，换前面的，后面的3000不要动</span></span><br><span class="line">    <span class="attr">volumes:</span></span><br><span class="line">      <span class="bullet">-</span> <span class="string">./data:/app/data</span></span><br><span class="line">    <span class="comment">#   - ./data/localtime:/etc/localtime:ro</span></span><br><span class="line">    <span class="comment">#   - ./data/timezone:/etc/timezone:ro</span></span><br></pre></td></tr></tbody></table></figure><p>注意文件，我将当前文件夹下的<code>./data</code>文件夹挂载了进去，数据都会在里面，迁移时仅需整体打包到新服务器即可。然后执行以下两条命令，后续需要升级也仅需要执行这两个命令：</p><figure class="highlight bash"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">docker-compose pull</span><br><span class="line">docker-compose up -d</span><br></pre></td></tr></tbody></table></figure><p>如果网络环境不佳，可尝试替换<code>docker</code>源，这里找了一篇参考文章：<a target="_blank" rel="external nofollow noopener noreferrer" href="/safego/?u=aHR0cHM6Ly9odWIuMXBhbmVsLmRldi8">Docker镜像加速说明</a>，这里我推荐使用<code>1panel</code>的国内镜像：<code>https://docker.1panel.live</code></p><p>如果一切正常，那么服务应该已经跑起来了，可以在终端输入：<code>curl 127.0.0.1:3003</code>，如果有输出，则代表正常。</p><p>通过反向代理将其添加到某个域名中，这里就不再多说了，各大面板都有极其完备的反代文档。</p><h4 id="Nginx修改"><a href="#Nginx修改" class="headerlink" title="Nginx修改"></a>Nginx修改</h4><p>在开头的<code>Waring</code>提到，<code>Moments</code>在跨域上没有进行任何设置，也就是默认的不允许跨域，这可能会导致无法在网站上使用<code>API</code>展示，如果你是<code>1panel</code>部署的服务，可以在网站管理中找到网站目录，点击进入：</p><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/02/18/67b4291707579.webp" alt="网站目录"></p><p>返回到上一级目录，也就是域名名称的文件夹下，找到<code>Proxy</code>文件夹，编辑里面的<code>root.conf</code>文件为如下内容：</p><figure class="highlight nginx"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 代理配置</span></span><br><span class="line"><span class="section">location</span> / {</span><br><span class="line">    <span class="comment"># 跨域设置</span></span><br><span class="line">    <span class="attribute">add_header</span> Access-Control-Allow-Origin *;  <span class="comment"># 允许所有域名访问，你也可以指定具体域名</span></span><br><span class="line">    <span class="attribute">add_header</span> Access-Control-Allow-Methods <span class="string">'GET, POST, PUT, DELETE, OPTIONS'</span>;  <span class="comment"># 允许的 HTTP 方法</span></span><br><span class="line">    <span class="attribute">add_header</span> Access-Control-Allow-Headers <span class="string">'Origin, X-Requested-With, Content-Type, Accept, Authorization'</span>;  <span class="comment"># 允许的请求头</span></span><br><span class="line"></span><br><span class="line">    <span class="comment"># 处理 OPTIONS 请求，预检请求</span></span><br><span class="line">    <span class="attribute">if</span> (<span class="variable">$request_method</span> = <span class="string">'OPTIONS'</span>) {</span><br><span class="line">        <span class="attribute">add_header</span> Access-Control-Allow-Origin *;</span><br><span class="line">        <span class="attribute">add_header</span> Access-Control-Allow-Methods <span class="string">'GET, POST, PUT, DELETE, OPTIONS'</span>;</span><br><span class="line">        <span class="attribute">add_header</span> Access-Control-Allow-Headers <span class="string">'Origin, X-Requested-With, Content-Type, Accept, Authorization'</span>;</span><br><span class="line">        <span class="attribute">add_header</span> Access-Control-Max-Age <span class="number">1728000</span>;</span><br><span class="line">        <span class="attribute">add_header</span> Content-Type <span class="string">'text/plain charset=UTF-8'</span>;</span><br><span class="line">        <span class="attribute">add_header</span> Content-Length <span class="number">0</span>;</span><br><span class="line">        <span class="attribute">return</span> <span class="number">204</span>;</span><br><span class="line">    }</span><br><span class="line"></span><br><span class="line">    <span class="comment"># 原代理设置</span></span><br><span class="line">    <span class="attribute">proxy_pass</span> http://127.0.0.1:3003;</span><br><span class="line">    <span class="attribute">proxy_set_header</span> Host <span class="variable">$host</span>;</span><br><span class="line">    <span class="attribute">proxy_set_header</span> X-Real-IP <span class="variable">$remote_addr</span>;</span><br><span class="line">    <span class="attribute">proxy_set_header</span> X-Forwarded-For <span class="variable">$proxy_add_x_forwarded_for</span>;</span><br><span class="line">    <span class="attribute">proxy_set_header</span> REMOTE-HOST <span class="variable">$remote_addr</span>;</span><br><span class="line">    <span class="attribute">proxy_set_header</span> Upgrade <span class="variable">$http_upgrade</span>;</span><br><span class="line">    <span class="attribute">proxy_set_header</span> Connection <span class="variable">$http_connection</span>;</span><br><span class="line">    <span class="attribute">proxy_set_header</span> X-Forwarded-Proto <span class="variable">$scheme</span>;</span><br><span class="line">    <span class="attribute">proxy_http_version</span> <span class="number">1</span>.<span class="number">1</span>;</span><br><span class="line">    <span class="attribute">add_header</span> X-Cache <span class="variable">$upstream_cache_status</span>;</span><br><span class="line">    <span class="attribute">add_header</span> Cache-Control <span class="literal">no</span>-cache;</span><br><span class="line">    <span class="attribute">proxy_ssl_server_name</span> <span class="literal">off</span>;</span><br><span class="line">    <span class="attribute">proxy_ssl_name</span> <span class="variable">$proxy_host</span>;</span><br><span class="line">    <span class="attribute">add_header</span> Strict-Transport-Security <span class="string">"max-age=31536000"</span>;</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure><p>下面是原代理设置，可以仅仅复制上面部分内容，下面保持不变，注意端口不要出问题。</p><p>如果是宝塔面板，可以在网站设置的配置文件找到<code>Nginx</code>配置文件，依照以上配置进行添加请求头部分，也可以通过最下面其他设置中的<code>跨域访问CORS配置</code>部分快捷的进行设置：</p><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/02/18/67b42a6ab53a6.webp" alt="宝塔设置"></p><p>如果你是兰亭雷池进行的外部<code>Nginx</code>，找到目录<code>/data/safeline/resources/nginx/custom_params</code>，在里面找到你的对应的配置，每个网站有一个唯一ID，为递增排序，如果不知道对应哪一个，可以查看上一目录中的<code>sites-enable</code>目录下的文件，其中有一定的信息可以助你分辨是否为对应配置。</p><div class="note note-info"><div class="note-header"><i class="note-icon fa-regular fa-circle-check"></i> <span class="note-title">编辑工具说明</span></div><div class="note-content"><p>当然这里的编辑工具可以使任何可以编辑的页面，可视化是最方便的，这里是由于腾讯云无法通过<code>root</code>直接登录，打开的可视化界面权限不够，所以我选择在页面中使用管理员权限打开<code>vim</code>进行编辑。</p></div></div><p>比如我在这里是<code>backend_29</code>文件，在该目录下打开命令行并执行<code>sudo vi ./backend_29</code>，打开<code>vim</code>，点击<code>i</code>进行编辑，粘贴下面的内容：</p><figure class="highlight nginx"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">add_header</span> Access-Control-Allow-Origin * always;</span><br><span class="line"><span class="attribute">add_header</span> Access-Control-Allow-Methods * always;</span><br><span class="line"><span class="attribute">add_header</span> Access-Control-Allow-Headers * always;</span><br></pre></td></tr></tbody></table></figure><p>编辑完成后，点击<code>esc</code>退出编辑，输入<code>:wq</code>进行保存，然后执行以下命令，检查配置文件是否运行正常：</p><figure class="highlight bash"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">docker <span class="built_in">exec</span> safeline-tengine nginx -t</span><br><span class="line"><span class="comment"># 下面是正常输出，不要复制进去了</span></span><br><span class="line"><span class="comment"># nginx: the configuration file /etc/nginx/nginx.conf syntax is ok</span></span><br><span class="line"><span class="comment"># nginx: configuration file /etc/nginx/nginx.conf test is successful</span></span><br></pre></td></tr></tbody></table></figure><p>如果输出正常，执行命令重启<code>Nginx</code>：</p><figure class="highlight bash"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">docker <span class="built_in">exec</span> safeline-tengine nginx -s reload</span><br></pre></td></tr></tbody></table></figure><p>此时跨域配置应该就结束了，下面教大家如何将其数据在前端进行展示。</p><div class="note note-info"><div class="note-header"><i class="note-icon fa-regular fa-circle-check"></i> <span class="note-title">笨蛋声明</span></div><div class="note-content"><p><code>Nginx</code>配置部分我也不是很懂，只是我通过这样的方式实践后是可行的，如果有更加优秀的配置欢迎留言！</p></div></div><h3 id="前端实现"><a href="#前端实现" class="headerlink" title="前端实现"></a>前端实现</h3><h4 id="说说页面"><a href="#说说页面" class="headerlink" title="说说页面"></a>说说页面</h4><p>由于该项目利用了<code>MetingJS</code>和<code>APlayer</code>，所以请提前引入这两个包，<code>Hexo-theme-butterfly</code>中虽然有内置的两个包，仅需修改配置文件即可开启，但是版本比较老，这里我建议自行引入最新版本，在配置中引入以下文件，注意css和js应该是分开引入的：</p><figure class="highlight html"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">link</span> <span class="attr">rel</span>=<span class="string">"stylesheet"</span> <span class="attr">href</span>=<span class="string">"https://fastly.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.css"</span> <span class="attr">media</span>=<span class="string">"all"</span> <span class="attr">onload</span>=<span class="string">"this.media=<span class="symbol">&amp;quot;</span>all<span class="symbol">&amp;quot;</span>"</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">"https://fastly.jsdelivr.net/npm/aplayer@1.10.1/dist/APlayer.min.js"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br><span class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">"https://fastly.jsdelivr.net/npm/meting@2.0.1/dist/Meting.min.js"</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br></pre></td></tr></tbody></table></figure><p>新建页面<code>shuoshuo</code>，在文件内写入一下内容：</p><figure class="highlight markdown"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: 日常哔哔，键盘侠的日常吐槽</span><br><span class="line"><span class="section">aside: false</span></span><br><span class="line"><span class="section">---</span></span><br><span class="line"><span class="language-xml"><span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">"talk"</span>&gt;</span></span><span class="language-xml"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span></span><br><span class="line"><span class="language-xml"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">"limit"</span>&gt;</span></span>- 只展示最近30条说说 -<span class="language-xml"><span class="tag">&lt;/<span class="name">div</span>&gt;</span></span></span><br><span class="line"><span class="language-xml"><span class="tag">&lt;<span class="name">script</span> <span class="attr">src</span>=<span class="string">"/js/shuoshuo.js"</span> <span class="attr">no-pjax</span>&gt;</span></span><span class="language-xml"><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span></span><br></pre></td></tr></tbody></table></figure><p>其中的<code>JS</code>文件地址清自行修改，自行创建，并写入以下内容：</p><figure class="highlight javascript"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br><span class="line">317</span><br><span class="line">318</span><br><span class="line">319</span><br><span class="line">320</span><br><span class="line">321</span><br><span class="line">322</span><br><span class="line">323</span><br><span class="line">324</span><br><span class="line">325</span><br><span class="line">326</span><br><span class="line">327</span><br><span class="line">328</span><br><span class="line">329</span><br><span class="line">330</span><br><span class="line">331</span><br><span class="line">332</span><br><span class="line">333</span><br><span class="line">334</span><br><span class="line">335</span><br><span class="line">336</span><br><span class="line">337</span><br><span class="line">338</span><br><span class="line">339</span><br><span class="line">340</span><br><span class="line">341</span><br><span class="line">342</span><br><span class="line">343</span><br><span class="line">344</span><br><span class="line">345</span><br><span class="line">346</span><br><span class="line">347</span><br><span class="line">348</span><br><span class="line">349</span><br><span class="line">350</span><br><span class="line">351</span><br><span class="line">352</span><br><span class="line">353</span><br><span class="line">354</span><br><span class="line">355</span><br><span class="line">356</span><br><span class="line">357</span><br><span class="line">358</span><br><span class="line">359</span><br><span class="line">360</span><br><span class="line">361</span><br><span class="line">362</span><br><span class="line">363</span><br><span class="line">364</span><br><span class="line">365</span><br><span class="line">366</span><br><span class="line">367</span><br><span class="line">368</span><br><span class="line">369</span><br><span class="line">370</span><br><span class="line">371</span><br><span class="line">372</span><br><span class="line">373</span><br><span class="line">374</span><br><span class="line">375</span><br><span class="line">376</span><br><span class="line">377</span><br><span class="line">378</span><br><span class="line">379</span><br><span class="line">380</span><br><span class="line">381</span><br><span class="line">382</span><br><span class="line">383</span><br><span class="line">384</span><br><span class="line">385</span><br><span class="line">386</span><br><span class="line">387</span><br><span class="line">388</span><br><span class="line">389</span><br><span class="line">390</span><br><span class="line">391</span><br><span class="line">392</span><br><span class="line">393</span><br><span class="line">394</span><br><span class="line">395</span><br><span class="line">396</span><br><span class="line">397</span><br><span class="line">398</span><br><span class="line">399</span><br><span class="line">400</span><br><span class="line">401</span><br><span class="line">402</span><br><span class="line">403</span><br><span class="line">404</span><br><span class="line">405</span><br><span class="line">406</span><br><span class="line">407</span><br><span class="line">408</span><br><span class="line">409</span><br><span class="line">410</span><br><span class="line">411</span><br><span class="line">412</span><br><span class="line">413</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">function</span> <span class="title function_">renderTalks</span>(<span class="params"></span>) {</span><br><span class="line">    <span class="keyword">const</span> talkContainer = <span class="variable language_">document</span>.<span class="title function_">querySelector</span>(<span class="string">'#talk'</span>);</span><br><span class="line">    <span class="keyword">if</span> (!talkContainer) <span class="keyword">return</span>;</span><br><span class="line">    talkContainer.<span class="property">innerHTML</span> = <span class="string">''</span>;</span><br><span class="line">    <span class="keyword">const</span> <span class="title function_">generateIconSVG</span> = (<span class="params"></span>) =&gt; {</span><br><span class="line">        <span class="keyword">return</span> <span class="string">`&lt;svg viewBox="0 0 512 512"xmlns="http://www.w3.org/2000/svg"class="is-badge icon"&gt;&lt;path d="m512 268c0 17.9-4.3 34.5-12.9 49.7s-20.1 27.1-34.6 35.4c.4 2.7.6 6.9.6 12.6 0 27.1-9.1 50.1-27.1 69.1-18.1 19.1-39.9 28.6-65.4 28.6-11.4 0-22.3-2.1-32.6-6.3-8 16.4-19.5 29.6-34.6 39.7-15 10.2-31.5 15.2-49.4 15.2-18.3 0-34.9-4.9-49.7-14.9-14.9-9.9-26.3-23.2-34.3-40-10.3 4.2-21.1 6.3-32.6 6.3-25.5 0-47.4-9.5-65.7-28.6-18.3-19-27.4-42.1-27.4-69.1 0-3 .4-7.2 1.1-12.6-14.5-8.4-26-20.2-34.6-35.4-8.5-15.2-12.8-31.8-12.8-49.7 0-19 4.8-36.5 14.3-52.3s22.3-27.5 38.3-35.1c-4.2-11.4-6.3-22.9-6.3-34.3 0-27 9.1-50.1 27.4-69.1s40.2-28.6 65.7-28.6c11.4 0 22.3 2.1 32.6 6.3 8-16.4 19.5-29.6 34.6-39.7 15-10.1 31.5-15.2 49.4-15.2s34.4 5.1 49.4 15.1c15 10.1 26.6 23.3 34.6 39.7 10.3-4.2 21.1-6.3 32.6-6.3 25.5 0 47.3 9.5 65.4 28.6s27.1 42.1 27.1 69.1c0 12.6-1.9 24-5.7 34.3 16 7.6 28.8 19.3 38.3 35.1 9.5 15.9 14.3 33.4 14.3 52.4zm-266.9 77.1 105.7-158.3c2.7-4.2 3.5-8.8 2.6-13.7-1-4.9-3.5-8.8-7.7-11.4-4.2-2.7-8.8-3.6-13.7-2.9-5 .8-9 3.2-12 7.4l-93.1 140-42.9-42.8c-3.8-3.8-8.2-5.6-13.1-5.4-5 .2-9.3 2-13.1 5.4-3.4 3.4-5.1 7.7-5.1 12.9 0 5.1 1.7 9.4 5.1 12.9l58.9 58.9 2.9 2.3c3.4 2.3 6.9 3.4 10.3 3.4 6.7-.1 11.8-2.9 15.2-8.7z"fill="#1da1f2"&gt;&lt;/path&gt;&lt;/svg&gt;`</span>;</span><br><span class="line">    }</span><br><span class="line">    <span class="keyword">const</span> <span class="title function_">waterfall</span> = (<span class="params">a</span>) =&gt; {</span><br><span class="line">        <span class="keyword">function</span> <span class="title function_">b</span>(<span class="params">a, b</span>) {</span><br><span class="line">            <span class="keyword">var</span> c = <span class="variable language_">window</span>.<span class="title function_">getComputedStyle</span>(b);</span><br><span class="line">            <span class="keyword">return</span> <span class="built_in">parseFloat</span>(c[<span class="string">"margin"</span> + a]) || <span class="number">0</span></span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">function</span> <span class="title function_">c</span>(<span class="params">a</span>) {</span><br><span class="line">            <span class="keyword">return</span> a + <span class="string">"px"</span></span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">function</span> <span class="title function_">d</span>(<span class="params">a</span>) {</span><br><span class="line">            <span class="keyword">return</span> <span class="built_in">parseFloat</span>(a.<span class="property">style</span>.<span class="property">top</span>)</span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">function</span> <span class="title function_">e</span>(<span class="params">a</span>) {</span><br><span class="line">            <span class="keyword">return</span> <span class="built_in">parseFloat</span>(a.<span class="property">style</span>.<span class="property">left</span>)</span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">function</span> <span class="title function_">f</span>(<span class="params">a</span>) {</span><br><span class="line">            <span class="keyword">return</span> a.<span class="property">clientWidth</span></span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">function</span> <span class="title function_">g</span>(<span class="params">a</span>) {</span><br><span class="line">            <span class="keyword">return</span> a.<span class="property">clientHeight</span></span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">function</span> <span class="title function_">h</span>(<span class="params">a</span>) {</span><br><span class="line">            <span class="keyword">return</span> <span class="title function_">d</span>(a) + <span class="title function_">g</span>(a) + <span class="title function_">b</span>(<span class="string">"Bottom"</span>, a)</span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">function</span> <span class="title function_">i</span>(<span class="params">a</span>) {</span><br><span class="line">            <span class="keyword">return</span> <span class="title function_">e</span>(a) + <span class="title function_">f</span>(a) + <span class="title function_">b</span>(<span class="string">"Right"</span>, a)</span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">function</span> <span class="title function_">j</span>(<span class="params">a</span>) {</span><br><span class="line">            a = a.<span class="title function_">sort</span>(<span class="keyword">function</span> (<span class="params">a, b</span>) {</span><br><span class="line">                <span class="keyword">return</span> <span class="title function_">h</span>(a) === <span class="title function_">h</span>(b) ? <span class="title function_">e</span>(b) - <span class="title function_">e</span>(a) : <span class="title function_">h</span>(b) - <span class="title function_">h</span>(a)</span><br><span class="line">            })</span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">function</span> <span class="title function_">k</span>(<span class="params">b</span>) {</span><br><span class="line">            <span class="title function_">f</span>(a) != t &amp;&amp; (b.<span class="property">target</span>.<span class="title function_">removeEventListener</span>(b.<span class="property">type</span>, <span class="variable language_">arguments</span>.<span class="property">callee</span>), <span class="title function_">waterfall</span>(a))</span><br><span class="line">        }</span><br><span class="line">        <span class="string">"string"</span> == <span class="keyword">typeof</span> a &amp;&amp; (a = <span class="variable language_">document</span>.<span class="title function_">querySelector</span>(a));</span><br><span class="line">        <span class="keyword">var</span> l = [].<span class="property">map</span>.<span class="title function_">call</span>(a.<span class="property">children</span>, <span class="keyword">function</span> (<span class="params">a</span>) {</span><br><span class="line">            <span class="keyword">return</span> a.<span class="property">style</span>.<span class="property">position</span> = <span class="string">"absolute"</span>, a</span><br><span class="line">        });</span><br><span class="line">        a.<span class="property">style</span>.<span class="property">position</span> = <span class="string">"relative"</span>;</span><br><span class="line">        <span class="keyword">var</span> m = [];</span><br><span class="line">        l.<span class="property">length</span> &amp;&amp; (l[<span class="number">0</span>].<span class="property">style</span>.<span class="property">top</span> = <span class="string">"0px"</span>, l[<span class="number">0</span>].<span class="property">style</span>.<span class="property">left</span> = <span class="title function_">c</span>(<span class="title function_">b</span>(<span class="string">"Left"</span>, l[<span class="number">0</span>])), m.<span class="title function_">push</span>(l[<span class="number">0</span>]));</span><br><span class="line">        <span class="keyword">for</span> (<span class="keyword">var</span> n = <span class="number">1</span>; n &lt; l.<span class="property">length</span>; n++) {</span><br><span class="line">            <span class="keyword">var</span> o = l[n - <span class="number">1</span>],</span><br><span class="line">                p = l[n],</span><br><span class="line">                q = <span class="title function_">i</span>(o) + <span class="title function_">f</span>(p) &lt;= <span class="title function_">f</span>(a);</span><br><span class="line">            <span class="keyword">if</span> (!q) <span class="keyword">break</span>;</span><br><span class="line">            p.<span class="property">style</span>.<span class="property">top</span> = o.<span class="property">style</span>.<span class="property">top</span>, p.<span class="property">style</span>.<span class="property">left</span> = <span class="title function_">c</span>(<span class="title function_">i</span>(o) + <span class="title function_">b</span>(<span class="string">"Left"</span>, p)), m.<span class="title function_">push</span>(p)</span><br><span class="line">        }</span><br><span class="line">        <span class="keyword">for</span> (; n &lt; l.<span class="property">length</span>; n++) {</span><br><span class="line">            <span class="title function_">j</span>(m);</span><br><span class="line">            <span class="keyword">var</span> p = l[n],</span><br><span class="line">                r = m.<span class="title function_">pop</span>();</span><br><span class="line">            p.<span class="property">style</span>.<span class="property">top</span> = <span class="title function_">c</span>(<span class="title function_">h</span>(r) + <span class="title function_">b</span>(<span class="string">"Top"</span>, p)), p.<span class="property">style</span>.<span class="property">left</span> = <span class="title function_">c</span>(<span class="title function_">e</span>(r)), m.<span class="title function_">push</span>(p)</span><br><span class="line">        }</span><br><span class="line">        <span class="title function_">j</span>(m);</span><br><span class="line">        <span class="keyword">var</span> s = m[<span class="number">0</span>];</span><br><span class="line">        a.<span class="property">style</span>.<span class="property">height</span> = <span class="title function_">c</span>(<span class="title function_">h</span>(s) + <span class="title function_">b</span>(<span class="string">"Bottom"</span>, s));</span><br><span class="line">        <span class="keyword">var</span> t = <span class="title function_">f</span>(a);</span><br><span class="line">        <span class="variable language_">window</span>.<span class="property">addEventListener</span> ? <span class="variable language_">window</span>.<span class="title function_">addEventListener</span>(<span class="string">"resize"</span>, k) : <span class="variable language_">document</span>.<span class="property">body</span>.<span class="property">onresize</span> = k</span><br><span class="line">    };</span><br><span class="line"></span><br><span class="line">    <span class="keyword">const</span> <span class="title function_">fetchAndRenderTalks</span> = (<span class="params"></span>) =&gt; {</span><br><span class="line">        <span class="keyword">const</span> url = <span class="string">'https://mm.liushen.fun/api/memo/list'</span>;</span><br><span class="line">        <span class="keyword">const</span> cacheKey = <span class="string">'talksCache'</span>;</span><br><span class="line">        <span class="keyword">const</span> cacheTimeKey = <span class="string">'talksCacheTime'</span>;</span><br><span class="line">        <span class="keyword">const</span> cacheDuration = <span class="number">30</span> * <span class="number">60</span> * <span class="number">1000</span>; <span class="comment">// 半个小时 (30 分钟)</span></span><br><span class="line">    </span><br><span class="line">        <span class="keyword">const</span> cachedData = <span class="variable language_">localStorage</span>.<span class="title function_">getItem</span>(cacheKey);</span><br><span class="line">        <span class="keyword">const</span> cachedTime = <span class="variable language_">localStorage</span>.<span class="title function_">getItem</span>(cacheTimeKey);</span><br><span class="line">        <span class="keyword">const</span> currentTime = <span class="keyword">new</span> <span class="title class_">Date</span>().<span class="title function_">getTime</span>();</span><br><span class="line">    </span><br><span class="line">        <span class="comment">// 判断缓存是否有效</span></span><br><span class="line">        <span class="keyword">if</span> (cachedData &amp;&amp; cachedTime &amp;&amp; (currentTime - cachedTime &lt; cacheDuration)) {</span><br><span class="line">            <span class="keyword">const</span> data = <span class="title class_">JSON</span>.<span class="title function_">parse</span>(cachedData);</span><br><span class="line">            <span class="title function_">renderTalks</span>(data); <span class="comment">// 使用缓存渲染数据</span></span><br><span class="line">        } <span class="keyword">else</span> {</span><br><span class="line">            <span class="keyword">if</span> (talkContainer) {</span><br><span class="line">                talkContainer.<span class="property">innerHTML</span> = <span class="string">''</span>;</span><br><span class="line">                <span class="title function_">fetch</span>(url, {</span><br><span class="line">                        <span class="attr">method</span>: <span class="string">'POST'</span>,</span><br><span class="line">                        <span class="attr">headers</span>: {</span><br><span class="line">                            <span class="string">'Content-Type'</span>: <span class="string">'application/json'</span>,</span><br><span class="line">                        },</span><br><span class="line">                        <span class="attr">body</span>: <span class="title class_">JSON</span>.<span class="title function_">stringify</span>({</span><br><span class="line">                            <span class="attr">size</span>: <span class="number">30</span></span><br><span class="line">                        })</span><br><span class="line">                    })</span><br><span class="line">                    .<span class="title function_">then</span>(<span class="function"><span class="params">res</span> =&gt;</span> res.<span class="title function_">json</span>())</span><br><span class="line">                    .<span class="title function_">then</span>(<span class="function"><span class="params">data</span> =&gt;</span> {</span><br><span class="line">                        <span class="keyword">if</span> (data.<span class="property">code</span> === <span class="number">0</span> &amp;&amp; data.<span class="property">data</span> &amp;&amp; <span class="title class_">Array</span>.<span class="title function_">isArray</span>(data.<span class="property">data</span>.<span class="property">list</span>)) {</span><br><span class="line">                            <span class="comment">// 缓存数据</span></span><br><span class="line">                            <span class="variable language_">localStorage</span>.<span class="title function_">setItem</span>(cacheKey, <span class="title class_">JSON</span>.<span class="title function_">stringify</span>(data.<span class="property">data</span>.<span class="property">list</span>));</span><br><span class="line">                            <span class="variable language_">localStorage</span>.<span class="title function_">setItem</span>(cacheTimeKey, currentTime.<span class="title function_">toString</span>());</span><br><span class="line">                            <span class="title function_">renderTalks</span>(data.<span class="property">data</span>.<span class="property">list</span>); <span class="comment">// 渲染数据</span></span><br><span class="line">                        }</span><br><span class="line">                    })</span><br><span class="line">                    .<span class="title function_">catch</span>(<span class="function"><span class="params">error</span> =&gt;</span> {</span><br><span class="line">                        <span class="variable language_">console</span>.<span class="title function_">error</span>(<span class="string">'Error fetching data:'</span>, error);</span><br><span class="line">                    });</span><br><span class="line">            }</span><br><span class="line">        }</span><br><span class="line">    </span><br><span class="line">        <span class="comment">// 渲染函数</span></span><br><span class="line">        <span class="keyword">function</span> <span class="title function_">renderTalks</span>(<span class="params">list</span>) {</span><br><span class="line">            <span class="comment">// 确保 data 是一个数组</span></span><br><span class="line">            <span class="keyword">if</span> (<span class="title class_">Array</span>.<span class="title function_">isArray</span>(list)) {</span><br><span class="line">                <span class="keyword">let</span> items = list.<span class="title function_">map</span>(<span class="function"><span class="params">item</span> =&gt;</span> <span class="title function_">formatTalk</span>(item, url));</span><br><span class="line">                items.<span class="title function_">forEach</span>(<span class="function"><span class="params">item</span> =&gt;</span> talkContainer.<span class="title function_">appendChild</span>(<span class="title function_">generateTalkElement</span>(item)));</span><br><span class="line">                <span class="title function_">waterfall</span>(<span class="string">'#talk'</span>);</span><br><span class="line">            } <span class="keyword">else</span> {</span><br><span class="line">                <span class="variable language_">console</span>.<span class="title function_">error</span>(<span class="string">'Data is not an array:'</span>, list);</span><br><span class="line">            }</span><br><span class="line">        }</span><br><span class="line">    };</span><br><span class="line">    </span><br><span class="line"></span><br><span class="line">    <span class="keyword">const</span> <span class="title function_">formatTalk</span> = (<span class="params">item, url</span>) =&gt; {</span><br><span class="line">        <span class="keyword">let</span> date = <span class="title function_">formatTime</span>(<span class="keyword">new</span> <span class="title class_">Date</span>(item.<span class="property">createdAt</span>).<span class="title function_">toString</span>());</span><br><span class="line">        <span class="keyword">let</span> content = item.<span class="property">content</span>;</span><br><span class="line">        <span class="keyword">let</span> imgs = item.<span class="property">imgs</span> ? item.<span class="property">imgs</span>.<span class="title function_">split</span>(<span class="string">','</span>) : [];</span><br><span class="line">        <span class="keyword">let</span> text = content;</span><br><span class="line">        content = text.<span class="title function_">replace</span>(<span class="regexp">/\[(.*?)\]\((.*?)\)/g</span>, <span class="string">`&lt;a href="$2"&gt;@$1&lt;/a&gt;`</span>)</span><br><span class="line">            .<span class="title function_">replace</span>(<span class="regexp">/- \[ \]/g</span>, <span class="string">'⚪'</span>)</span><br><span class="line">            .<span class="title function_">replace</span>(<span class="regexp">/- \[x\]/g</span>, <span class="string">'⚫'</span>);</span><br><span class="line">        <span class="comment">// 保留换行符，转换 \n 为 &lt;br&gt;</span></span><br><span class="line">		content = content.<span class="title function_">replace</span>(<span class="regexp">/\n/g</span>, <span class="string">'&lt;br&gt;'</span>);</span><br><span class="line">        <span class="comment">// 将content用一个类包裹，便于后续处理</span></span><br><span class="line">        content = <span class="string">`&lt;div class="talk_content_text"&gt;<span class="subst">${content}</span>&lt;/div&gt;`</span>;</span><br><span class="line">        <span class="keyword">if</span> (imgs.<span class="property">length</span> &gt; <span class="number">0</span>) {</span><br><span class="line">            <span class="keyword">const</span> imgDiv = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'div'</span>);</span><br><span class="line">            imgDiv.<span class="property">className</span> = <span class="string">'zone_imgbox'</span>;</span><br><span class="line">            imgs.<span class="title function_">forEach</span>(<span class="function"><span class="params">e</span> =&gt;</span> {</span><br><span class="line">                <span class="keyword">const</span> imgLink = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'a'</span>);</span><br><span class="line">                imgLink.<span class="property">href</span> = e;</span><br><span class="line">                imgLink.<span class="title function_">setAttribute</span>(<span class="string">'data-fancybox'</span>, <span class="string">'gallery'</span>);</span><br><span class="line">                imgLink.<span class="property">className</span> = <span class="string">'fancybox'</span>;</span><br><span class="line">                imgLink.<span class="title function_">setAttribute</span>(<span class="string">'data-thumb'</span>, e);</span><br><span class="line">                <span class="keyword">const</span> imgTag = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'img'</span>);</span><br><span class="line">                imgTag.<span class="property">src</span> = e;</span><br><span class="line">                imgLink.<span class="title function_">appendChild</span>(imgTag);</span><br><span class="line">                imgDiv.<span class="title function_">appendChild</span>(imgLink);</span><br><span class="line">            });</span><br><span class="line">            content += imgDiv.<span class="property">outerHTML</span>;</span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="comment">// 外链分享功能</span></span><br><span class="line">        <span class="keyword">if</span> (item.<span class="property">externalUrl</span>) {</span><br><span class="line">            <span class="keyword">const</span> externalUrl = item.<span class="property">externalUrl</span>;</span><br><span class="line">            <span class="keyword">const</span> externalTitle = item.<span class="property">externalTitle</span>;</span><br><span class="line">            <span class="keyword">const</span> externalFavicon = item.<span class="property">externalFavicon</span>;</span><br><span class="line"></span><br><span class="line">            <span class="keyword">const</span> externalContainer = <span class="string">`</span></span><br><span class="line"><span class="string">            &lt;div class="shuoshuo-external-link"&gt;</span></span><br><span class="line"><span class="string">                &lt;a class="external-link" href="<span class="subst">${externalUrl}</span>" target="_blank" rel="external nofollow noopener noreferrer"&gt;</span></span><br><span class="line"><span class="string">                    &lt;div class="external-link-left" style="background-image: url(<span class="subst">${externalFavicon}</span>)"&gt;&lt;/div&gt;</span></span><br><span class="line"><span class="string">                    &lt;div class="external-link-right"&gt;</span></span><br><span class="line"><span class="string">                        &lt;div class="external-link-title"&gt;<span class="subst">${externalTitle}</span>&lt;/div&gt;</span></span><br><span class="line"><span class="string">                        &lt;div&gt;点击跳转&lt;i class="fa-solid fa-angle-right"&gt;&lt;/i&gt;&lt;/div&gt;</span></span><br><span class="line"><span class="string">                    &lt;/div&gt;</span></span><br><span class="line"><span class="string">                &lt;/a&gt;</span></span><br><span class="line"><span class="string">            &lt;/div&gt;`</span>;</span><br><span class="line"></span><br><span class="line">            content += externalContainer;</span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">const</span> ext = <span class="title class_">JSON</span>.<span class="title function_">parse</span>(item.<span class="property">ext</span> || <span class="string">'{}'</span>);</span><br><span class="line"></span><br><span class="line">        <span class="keyword">if</span> (ext.<span class="property">music</span> &amp;&amp; ext.<span class="property">music</span>.<span class="property">id</span>) {</span><br><span class="line">            <span class="keyword">const</span> music = ext.<span class="property">music</span>;</span><br><span class="line">            <span class="keyword">const</span> musicUrl = music.<span class="property">api</span>.<span class="title function_">replace</span>(<span class="string">':server'</span>, music.<span class="property">server</span>)</span><br><span class="line">                .<span class="title function_">replace</span>(<span class="string">':type'</span>, music.<span class="property">type</span>)</span><br><span class="line">                .<span class="title function_">replace</span>(<span class="string">':id'</span>, music.<span class="property">id</span>);</span><br><span class="line">            content += <span class="string">`</span></span><br><span class="line"><span class="string">            &lt;meting-js server="<span class="subst">${music.server}</span>" type="<span class="subst">${music.type}</span>" id="<span class="subst">${music.id}</span>" api="<span class="subst">${music.api}</span>"&gt;&lt;/meting-js&gt;</span></span><br><span class="line"><span class="string">        `</span>;</span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">if</span> (ext.<span class="property">doubanMovie</span> &amp;&amp; ext.<span class="property">doubanMovie</span>.<span class="property">id</span>) {</span><br><span class="line">            <span class="keyword">const</span> doubanMovie = ext.<span class="property">doubanMovie</span>;</span><br><span class="line">            <span class="keyword">const</span> doubanMovieUrl = doubanMovie.<span class="property">url</span>;</span><br><span class="line">            <span class="keyword">const</span> doubanTitle = doubanMovie.<span class="property">title</span>;</span><br><span class="line">            <span class="comment">// const doubanDesc = doubanMovie.desc || '暂无描述';</span></span><br><span class="line">            <span class="keyword">const</span> doubanImage = doubanMovie.<span class="property">image</span>;</span><br><span class="line">            <span class="keyword">const</span> doubanDirector = doubanMovie.<span class="property">director</span> || <span class="string">'未知导演'</span>;</span><br><span class="line">            <span class="keyword">const</span> doubanRating = doubanMovie.<span class="property">rating</span> || <span class="string">'暂无评分'</span>;</span><br><span class="line">            <span class="comment">// const doubanReleaseDate = doubanMovie.releaseDate || '未知上映时间';</span></span><br><span class="line">            <span class="comment">// const doubanActors = doubanMovie.actors || '未知演员';</span></span><br><span class="line">            <span class="keyword">const</span> doubanRuntime = doubanMovie.<span class="property">runtime</span> || <span class="string">'未知时长'</span>;</span><br><span class="line"></span><br><span class="line">            content += <span class="string">`</span></span><br><span class="line"><span class="string">                &lt;a class="douban-card" href="<span class="subst">${doubanMovieUrl}</span>" target="_blank"&gt;</span></span><br><span class="line"><span class="string">                    &lt;div class="douban-card-bgimg" style="background-image: url('<span class="subst">${doubanImage}</span>');"&gt;&lt;/div&gt;</span></span><br><span class="line"><span class="string">                    &lt;div class="douban-card-left"&gt;</span></span><br><span class="line"><span class="string">                        &lt;div class="douban-card-img" style="background-image: url('<span class="subst">${doubanImage}</span>');"&gt;&lt;/div&gt;</span></span><br><span class="line"><span class="string">                    &lt;/div&gt;</span></span><br><span class="line"><span class="string">                    &lt;div class="douban-card-right"&gt;</span></span><br><span class="line"><span class="string">                        &lt;div class="douban-card-item"&gt;&lt;span&gt;电影名: &lt;/span&gt;&lt;strong&gt;<span class="subst">${doubanTitle}</span>&lt;/strong&gt;&lt;/div&gt;</span></span><br><span class="line"><span class="string">                        &lt;div class="douban-card-item"&gt;&lt;span&gt;导演: &lt;/span&gt;&lt;span&gt;<span class="subst">${doubanDirector}</span>&lt;/span&gt;&lt;/div&gt;</span></span><br><span class="line"><span class="string">                        &lt;div class="douban-card-item"&gt;&lt;span&gt;评分: &lt;/span&gt;&lt;span&gt;<span class="subst">${doubanRating}</span>&lt;/span&gt;&lt;/div&gt;</span></span><br><span class="line"><span class="string">                        &lt;div class="douban-card-item"&gt;&lt;span&gt;时长: &lt;/span&gt;&lt;span&gt;<span class="subst">${doubanRuntime}</span>&lt;/span&gt;&lt;/div&gt;</span></span><br><span class="line"><span class="string">                    &lt;/div&gt;</span></span><br><span class="line"><span class="string">                &lt;/a&gt;</span></span><br><span class="line"><span class="string">            `</span>;</span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">if</span> (ext.<span class="property">doubanBook</span> &amp;&amp; ext.<span class="property">doubanBook</span>.<span class="property">id</span>) {</span><br><span class="line">            <span class="keyword">const</span> doubanBook = ext.<span class="property">doubanBook</span>;</span><br><span class="line">            <span class="keyword">const</span> bookUrl = doubanBook.<span class="property">url</span>;</span><br><span class="line">            <span class="keyword">const</span> bookTitle = doubanBook.<span class="property">title</span>;</span><br><span class="line">            <span class="comment">// const bookDesc = doubanBook.desc;</span></span><br><span class="line">            <span class="keyword">const</span> bookImage = doubanBook.<span class="property">image</span>;</span><br><span class="line">            <span class="keyword">const</span> bookAuthor = doubanBook.<span class="property">author</span>;</span><br><span class="line">            <span class="keyword">const</span> bookRating = doubanBook.<span class="property">rating</span>;</span><br><span class="line">            <span class="keyword">const</span> bookPubDate = doubanBook.<span class="property">pubDate</span>;</span><br><span class="line"></span><br><span class="line">            <span class="keyword">const</span> bookTemplate = <span class="string">`</span></span><br><span class="line"><span class="string">                &lt;a class="douban-card" href="<span class="subst">${bookUrl}</span>" target="_blank"&gt;</span></span><br><span class="line"><span class="string">                    &lt;div class="douban-card-bgimg" style="background-image: url('<span class="subst">${bookImage}</span>');"&gt;&lt;/div&gt;</span></span><br><span class="line"><span class="string">                        &lt;div class="douban-card-left"&gt;</span></span><br><span class="line"><span class="string">                            &lt;div class="douban-card-img" style="background-image: url('<span class="subst">${bookImage}</span>');"&gt;&lt;/div&gt;</span></span><br><span class="line"><span class="string">                        &lt;/div&gt;</span></span><br><span class="line"><span class="string">                        &lt;div class="douban-card-right"&gt;</span></span><br><span class="line"><span class="string">                            &lt;div class="douban-card-item"&gt;</span></span><br><span class="line"><span class="string">                                &lt;span&gt;书名: &lt;/span&gt;&lt;strong&gt;<span class="subst">${bookTitle}</span>&lt;/strong&gt;</span></span><br><span class="line"><span class="string">                            &lt;/div&gt;</span></span><br><span class="line"><span class="string">                            &lt;div class="douban-card-item"&gt;</span></span><br><span class="line"><span class="string">                                &lt;span&gt;作者: &lt;/span&gt;&lt;span&gt;<span class="subst">${bookAuthor}</span>&lt;/span&gt;</span></span><br><span class="line"><span class="string">                            &lt;/div&gt;</span></span><br><span class="line"><span class="string">                            &lt;div class="douban-card-item"&gt;</span></span><br><span class="line"><span class="string">                                &lt;span&gt;出版年份: &lt;/span&gt;&lt;span&gt;<span class="subst">${bookPubDate}</span>&lt;/span&gt;</span></span><br><span class="line"><span class="string">                            &lt;/div&gt;</span></span><br><span class="line"><span class="string">                            &lt;div class="douban-card-item"&gt;</span></span><br><span class="line"><span class="string">                                &lt;span&gt;评分: &lt;/span&gt;&lt;span&gt;<span class="subst">${bookRating}</span>&lt;/span&gt;</span></span><br><span class="line"><span class="string">                            &lt;/div&gt;</span></span><br><span class="line"><span class="string">                        &lt;/div&gt;</span></span><br><span class="line"><span class="string">                &lt;/a&gt;</span></span><br><span class="line"><span class="string">            `</span>;</span><br><span class="line"></span><br><span class="line">            content += bookTemplate;</span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">if</span> (ext.<span class="property">video</span> &amp;&amp; ext.<span class="property">video</span>.<span class="property">type</span>) {</span><br><span class="line">            <span class="keyword">const</span> videoType = ext.<span class="property">video</span>.<span class="property">type</span>;</span><br><span class="line">            <span class="keyword">const</span> videoUrl = ext.<span class="property">video</span>.<span class="property">value</span>;</span><br><span class="line">            <span class="keyword">if</span> (videoType === <span class="string">'bilibili'</span>) {</span><br><span class="line">                <span class="comment">// Bilibili 视频模板</span></span><br><span class="line">                <span class="comment">// 从形如https://www.bilibili.com/video/BV1VGAPeAEMQ/?vd_source=91b3158d27d98ff41f842508c3794a13 的链接中提取视频 BV1VGAPeAEMQ</span></span><br><span class="line">                <span class="keyword">const</span> biliTemplate = <span class="string">`</span></span><br><span class="line"><span class="string">                &lt;div style="position: relative; padding: 30% 45%; margin-top: 10px;"&gt;</span></span><br><span class="line"><span class="string">                    &lt;iframe </span></span><br><span class="line"><span class="string">                        style="position: absolute; width: 100%; height: 100%; left: 0; top: 0; border-radius: 12px;" </span></span><br><span class="line"><span class="string">                        src="<span class="subst">${videoUrl}</span>&amp;autoplay=0"</span></span><br><span class="line"><span class="string">                        scrolling="no" </span></span><br><span class="line"><span class="string">                        frameborder="no" </span></span><br><span class="line"><span class="string">                        allowfullscreen&gt;</span></span><br><span class="line"><span class="string">                    &lt;/iframe&gt;</span></span><br><span class="line"><span class="string">                &lt;/div&gt;</span></span><br><span class="line"><span class="string">            `</span>;</span><br><span class="line">                <span class="comment">// 将模板插入到 DOM 中</span></span><br><span class="line">                content += biliTemplate;</span><br><span class="line"></span><br><span class="line">            } <span class="keyword">else</span> <span class="keyword">if</span> (videoType === <span class="string">'youtube'</span>) {</span><br><span class="line">                <span class="comment">// YouTube 视频模板</span></span><br><span class="line">                <span class="comment">// 从形如https://youtu.be/2V6lvCUPT8I?si=DVhUas6l6qlAr6Ru的链接中提取视频 ID2V6lvCUPT8I</span></span><br><span class="line">                <span class="keyword">const</span> youtubeTemplate = <span class="string">`</span></span><br><span class="line"><span class="string">                &lt;div style="position: relative; padding: 30% 45%; margin-top: 10px;"&gt;</span></span><br><span class="line"><span class="string">                    &lt;iframe width="100%"</span></span><br><span class="line"><span class="string">                        style="position: absolute; width: 100%; height: 100%; left: 0; top: 0; border-radius: 12px;"</span></span><br><span class="line"><span class="string">                        src="<span class="subst">${videoUrl}</span>"</span></span><br><span class="line"><span class="string">                        title="YouTube video player" </span></span><br><span class="line"><span class="string">                        frameborder="0" </span></span><br><span class="line"><span class="string">                        allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" </span></span><br><span class="line"><span class="string">                        referrerpolicy="strict-origin-when-cross-origin" </span></span><br><span class="line"><span class="string">                        allowfullscreen&gt;</span></span><br><span class="line"><span class="string">                    &lt;/iframe&gt;</span></span><br><span class="line"><span class="string">                &lt;/div&gt;</span></span><br><span class="line"><span class="string">            `</span>;</span><br><span class="line">                <span class="comment">// 将模板插入到 DOM 中</span></span><br><span class="line">                content += youtubeTemplate;</span><br><span class="line">            }</span><br><span class="line">        }</span><br><span class="line"></span><br><span class="line">        <span class="keyword">return</span> {</span><br><span class="line">            <span class="attr">content</span>: content,</span><br><span class="line">            <span class="attr">user</span>: item.<span class="property">user</span>.<span class="property">nickname</span> || <span class="string">'匿名'</span>,</span><br><span class="line">            <span class="attr">avatar</span>: item.<span class="property">user</span>.<span class="property">avatarUrl</span> || <span class="string">'https://p.liiiu.cn/i/2024/03/29/66061417537af.png'</span>,</span><br><span class="line">            <span class="attr">date</span>: date,</span><br><span class="line">            <span class="attr">location</span>: item.<span class="property">location</span> || <span class="string">'陕西西安'</span>,</span><br><span class="line">            <span class="attr">tags</span>: item.<span class="property">tags</span> ? item.<span class="property">tags</span>.<span class="title function_">split</span>(<span class="string">','</span>).<span class="title function_">filter</span>(<span class="function"><span class="params">tag</span> =&gt;</span> tag.<span class="title function_">trim</span>() !== <span class="string">''</span>) : [<span class="string">'无标签'</span>],</span><br><span class="line">            <span class="attr">text</span>: content.<span class="title function_">replace</span>(<span class="regexp">/\[(.*?)\]\((.*?)\)/g</span>, <span class="string">'[链接]'</span> + <span class="string">`<span class="subst">${imgs.length ? <span class="string">'[图片]'</span> : <span class="string">''</span>}</span>`</span>)</span><br><span class="line">        };</span><br><span class="line">    };</span><br><span class="line"></span><br><span class="line">    <span class="keyword">const</span> <span class="title function_">generateTalkElement</span> = (<span class="params">item</span>) =&gt; {</span><br><span class="line">        <span class="keyword">const</span> talkItem = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'div'</span>);</span><br><span class="line">        talkItem.<span class="property">className</span> = <span class="string">'talk_item'</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">const</span> talkMeta = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'div'</span>);</span><br><span class="line">        talkMeta.<span class="property">className</span> = <span class="string">'talk_meta'</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">const</span> avatar = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'img'</span>);</span><br><span class="line">        avatar.<span class="property">className</span> = <span class="string">'no-lightbox avatar'</span>;</span><br><span class="line">        avatar.<span class="property">src</span> = item.<span class="property">avatar</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">const</span> info = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'div'</span>);</span><br><span class="line">        info.<span class="property">className</span> = <span class="string">'info'</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">const</span> talkNick = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'span'</span>);</span><br><span class="line">        talkNick.<span class="property">className</span> = <span class="string">'talk_nick'</span>;</span><br><span class="line">        talkNick.<span class="property">innerHTML</span> = <span class="string">`<span class="subst">${item.user}</span> <span class="subst">${generateIconSVG()}</span>`</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">const</span> talkDate = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'span'</span>);</span><br><span class="line">        talkDate.<span class="property">className</span> = <span class="string">'talk_date'</span>;</span><br><span class="line">        talkDate.<span class="property">textContent</span> = item.<span class="property">date</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">const</span> talkContent = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'div'</span>);</span><br><span class="line">        talkContent.<span class="property">className</span> = <span class="string">'talk_content'</span>;</span><br><span class="line">        talkContent.<span class="property">innerHTML</span> = item.<span class="property">content</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">const</span> talkBottom = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'div'</span>);</span><br><span class="line">        talkBottom.<span class="property">className</span> = <span class="string">'talk_bottom'</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">const</span> <span class="title class_">TagContainer</span> = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'div'</span>);</span><br><span class="line"></span><br><span class="line">        <span class="keyword">const</span> talkTag = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'span'</span>);</span><br><span class="line">        talkTag.<span class="property">className</span> = <span class="string">'talk_tag'</span>;</span><br><span class="line">        talkTag.<span class="property">textContent</span> = <span class="string">`🏷️<span class="subst">${item.tags}</span>`</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">const</span> locationTag = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'span'</span>);</span><br><span class="line">        locationTag.<span class="property">className</span> = <span class="string">'location_tag'</span>;</span><br><span class="line">        locationTag.<span class="property">textContent</span> = <span class="string">`🌍<span class="subst">${item.location}</span>`</span>;</span><br><span class="line"></span><br><span class="line">        <span class="title class_">TagContainer</span>.<span class="title function_">appendChild</span>(talkTag);</span><br><span class="line">        <span class="title class_">TagContainer</span>.<span class="title function_">appendChild</span>(locationTag);</span><br><span class="line"></span><br><span class="line">        <span class="keyword">const</span> commentLink = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'a'</span>);</span><br><span class="line">        commentLink.<span class="property">href</span> = <span class="string">'javascript:;'</span>;</span><br><span class="line">        commentLink.<span class="property">onclick</span> = <span class="function">() =&gt;</span> <span class="title function_">goComment</span>(item.<span class="property">text</span>);</span><br><span class="line">        <span class="keyword">const</span> commentIcon = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'span'</span>);</span><br><span class="line">        commentIcon.<span class="property">className</span> = <span class="string">'icon'</span>;</span><br><span class="line">        <span class="keyword">const</span> commentIconInner = <span class="variable language_">document</span>.<span class="title function_">createElement</span>(<span class="string">'i'</span>);</span><br><span class="line">        commentIconInner.<span class="property">className</span> = <span class="string">'fa-solid fa-message fa-fw'</span>;</span><br><span class="line">        commentIcon.<span class="title function_">appendChild</span>(commentIconInner);</span><br><span class="line">        commentLink.<span class="title function_">appendChild</span>(commentIcon);</span><br><span class="line"></span><br><span class="line">        talkMeta.<span class="title function_">appendChild</span>(avatar);</span><br><span class="line">        info.<span class="title function_">appendChild</span>(talkNick);</span><br><span class="line">        info.<span class="title function_">appendChild</span>(talkDate);</span><br><span class="line">        talkMeta.<span class="title function_">appendChild</span>(info);</span><br><span class="line">        talkItem.<span class="title function_">appendChild</span>(talkMeta);</span><br><span class="line">        talkItem.<span class="title function_">appendChild</span>(talkContent);</span><br><span class="line">        talkBottom.<span class="title function_">appendChild</span>(<span class="title class_">TagContainer</span>);</span><br><span class="line">        talkBottom.<span class="title function_">appendChild</span>(commentLink);</span><br><span class="line">        talkItem.<span class="title function_">appendChild</span>(talkBottom);</span><br><span class="line"></span><br><span class="line">        <span class="keyword">return</span> talkItem;</span><br><span class="line">    };</span><br><span class="line"></span><br><span class="line">    <span class="keyword">const</span> <span class="title function_">goComment</span> = (<span class="params">e</span>) =&gt; {</span><br><span class="line">        <span class="keyword">const</span> match = e.<span class="title function_">match</span>(<span class="regexp">/&lt;div class="talk_content_text"&gt;([\s\S]*?)&lt;\/div&gt;/</span>);</span><br><span class="line">        <span class="keyword">const</span> textContent = match ? match[<span class="number">1</span>] : <span class="string">""</span>;</span><br><span class="line">        <span class="keyword">const</span> n = <span class="variable language_">document</span>.<span class="title function_">querySelector</span>(<span class="string">".atk-textarea"</span>);</span><br><span class="line">        n.<span class="property">value</span> = <span class="string">`&gt; <span class="subst">${textContent}</span>\n\n`</span>;</span><br><span class="line">        n.<span class="title function_">focus</span>();</span><br><span class="line">        btf.<span class="title function_">snackbarShow</span>(<span class="string">"已为您引用该说说，不删除空格效果更佳"</span>);</span><br><span class="line">        <span class="comment">// const n = document.querySelector(".atk-textarea");</span></span><br><span class="line">        <span class="comment">// n.value = `&gt; ${e}\n\n`;</span></span><br><span class="line">        <span class="comment">// n.focus();</span></span><br><span class="line">        <span class="comment">// btf.snackbarShow("已为您引用该说说，不删除空格效果更佳");</span></span><br><span class="line">    };</span><br><span class="line"></span><br><span class="line">    <span class="keyword">const</span> <span class="title function_">formatTime</span> = (<span class="params">time</span>) =&gt; {</span><br><span class="line">        <span class="keyword">const</span> d = <span class="keyword">new</span> <span class="title class_">Date</span>(time);</span><br><span class="line">        <span class="keyword">const</span> ls = [</span><br><span class="line">            d.<span class="title function_">getFullYear</span>(),</span><br><span class="line">            d.<span class="title function_">getMonth</span>() + <span class="number">1</span>,</span><br><span class="line">            d.<span class="title function_">getDate</span>(),</span><br><span class="line">            d.<span class="title function_">getHours</span>(),</span><br><span class="line">            d.<span class="title function_">getMinutes</span>(),</span><br><span class="line">            d.<span class="title function_">getSeconds</span>(),</span><br><span class="line">        ];</span><br><span class="line">        <span class="keyword">const</span> r = ls.<span class="title function_">map</span>(<span class="function">(<span class="params">a</span>) =&gt;</span> (a.<span class="title function_">toString</span>().<span class="property">length</span> === <span class="number">1</span> ? <span class="string">'0'</span> + a : a));</span><br><span class="line">        <span class="keyword">return</span> <span class="string">`<span class="subst">${r[<span class="number">0</span>]}</span>-<span class="subst">${r[<span class="number">1</span>]}</span>-<span class="subst">${r[<span class="number">2</span>]}</span> <span class="subst">${r[<span class="number">3</span>]}</span>:<span class="subst">${r[<span class="number">4</span>]}</span>`</span>;</span><br><span class="line">    };</span><br><span class="line"></span><br><span class="line">    <span class="title function_">fetchAndRenderTalks</span>();</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="title function_">renderTalks</span>();</span><br><span class="line"></span><br><span class="line"><span class="comment">// function whenDOMReady() {</span></span><br><span class="line"><span class="comment">//     const talkContainer = document.querySelector('#talk');</span></span><br><span class="line"><span class="comment">//     talkContainer.innerHTML = '';</span></span><br><span class="line"><span class="comment">//     fetchAndRenderTalks();</span></span><br><span class="line"><span class="comment">// }</span></span><br><span class="line"><span class="comment">// whenDOMReady();</span></span><br><span class="line"><span class="comment">// document.addEventListener("pjax:complete", whenDOMReady);</span></span><br></pre></td></tr></tbody></table></figure><p>自行修改<code>js</code>文件中的<code>Moments</code>地址为你的地址，在文件中，有一个<code>gocomment</code>函数，实现的是获取卡片中的文本内容，如果如果出现不匹配的情况，请自行修改一下类名，这里我匹配的是<code>artalk</code>的输入框。</p><p>然后引入样式文件，这个文件可以在配置文件中引用，也可以在页面文件中类似于<code>shuoshuo.js</code>一样引用，样式内容如下：</p><figure class="highlight css"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br><span class="line">201</span><br><span class="line">202</span><br><span class="line">203</span><br><span class="line">204</span><br><span class="line">205</span><br><span class="line">206</span><br><span class="line">207</span><br><span class="line">208</span><br><span class="line">209</span><br><span class="line">210</span><br><span class="line">211</span><br><span class="line">212</span><br><span class="line">213</span><br><span class="line">214</span><br><span class="line">215</span><br><span class="line">216</span><br><span class="line">217</span><br><span class="line">218</span><br><span class="line">219</span><br><span class="line">220</span><br><span class="line">221</span><br><span class="line">222</span><br><span class="line">223</span><br><span class="line">224</span><br><span class="line">225</span><br><span class="line">226</span><br><span class="line">227</span><br><span class="line">228</span><br><span class="line">229</span><br><span class="line">230</span><br><span class="line">231</span><br><span class="line">232</span><br><span class="line">233</span><br><span class="line">234</span><br><span class="line">235</span><br><span class="line">236</span><br><span class="line">237</span><br><span class="line">238</span><br><span class="line">239</span><br><span class="line">240</span><br><span class="line">241</span><br><span class="line">242</span><br><span class="line">243</span><br><span class="line">244</span><br><span class="line">245</span><br><span class="line">246</span><br><span class="line">247</span><br><span class="line">248</span><br><span class="line">249</span><br><span class="line">250</span><br><span class="line">251</span><br><span class="line">252</span><br><span class="line">253</span><br><span class="line">254</span><br><span class="line">255</span><br><span class="line">256</span><br><span class="line">257</span><br><span class="line">258</span><br><span class="line">259</span><br><span class="line">260</span><br><span class="line">261</span><br><span class="line">262</span><br><span class="line">263</span><br><span class="line">264</span><br><span class="line">265</span><br><span class="line">266</span><br><span class="line">267</span><br><span class="line">268</span><br><span class="line">269</span><br><span class="line">270</span><br><span class="line">271</span><br><span class="line">272</span><br><span class="line">273</span><br><span class="line">274</span><br><span class="line">275</span><br><span class="line">276</span><br><span class="line">277</span><br><span class="line">278</span><br><span class="line">279</span><br><span class="line">280</span><br><span class="line">281</span><br><span class="line">282</span><br><span class="line">283</span><br><span class="line">284</span><br><span class="line">285</span><br><span class="line">286</span><br><span class="line">287</span><br><span class="line">288</span><br><span class="line">289</span><br><span class="line">290</span><br><span class="line">291</span><br><span class="line">292</span><br><span class="line">293</span><br><span class="line">294</span><br><span class="line">295</span><br><span class="line">296</span><br><span class="line">297</span><br><span class="line">298</span><br><span class="line">299</span><br><span class="line">300</span><br><span class="line">301</span><br><span class="line">302</span><br><span class="line">303</span><br><span class="line">304</span><br><span class="line">305</span><br><span class="line">306</span><br><span class="line">307</span><br><span class="line">308</span><br><span class="line">309</span><br><span class="line">310</span><br><span class="line">311</span><br><span class="line">312</span><br><span class="line">313</span><br><span class="line">314</span><br><span class="line">315</span><br><span class="line">316</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-pseudo">:root</span> {</span><br><span class="line">    <span class="attr">--liushen-card-bg</span>: <span class="number">#fff</span>;</span><br><span class="line">    <span class="attr">--liushen-card-border</span>: <span class="number">1px</span> solid <span class="number">#e3e8f7</span>;</span><br><span class="line">    <span class="attr">--card-box-shadow</span>: <span class="number">0</span> <span class="number">3px</span> <span class="number">8px</span> <span class="number">6px</span> <span class="built_in">rgba</span>(<span class="number">7</span>,<span class="number">17</span>,<span class="number">27</span>,<span class="number">0.09</span>);</span><br><span class="line">    <span class="attr">--card-hover-box-shadow</span>: <span class="number">0</span> <span class="number">3px</span> <span class="number">8px</span> <span class="number">6px</span> <span class="built_in">rgba</span>(<span class="number">7</span>,<span class="number">17</span>,<span class="number">27</span>,<span class="number">0.2</span>);</span><br><span class="line">    <span class="attr">--liushen-card-secondbg</span>: <span class="number">#f1f3f8</span>;</span><br><span class="line">    <span class="attr">--liushen-button-hover-bg</span>: <span class="number">#2679cc</span>;</span><br><span class="line">    <span class="attr">--liushen-text</span>: <span class="number">#4c4948</span>;</span><br><span class="line">    <span class="attr">--liushen-button-bg</span>: <span class="number">#f1f3f8</span>;</span><br><span class="line">    <span class="attr">--liushen-fancybox-bg</span>: <span class="built_in">rgba</span>(<span class="number">255</span>,<span class="number">255</span>,<span class="number">255</span>,<span class="number">0.5</span>);</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-pseudo">:root</span>, <span class="selector-attr">[data-theme=dark]</span> {</span><br><span class="line">    <span class="attr">--liushen-card-bg</span>: <span class="number">#181818</span>;</span><br><span class="line">    <span class="attr">--liushen-card-secondbg</span>: <span class="number">#30343f</span>;</span><br><span class="line">    <span class="attr">--liushen-card-border</span>: <span class="number">1px</span> solid <span class="number">#42444a</span>;</span><br><span class="line">    <span class="attr">--card-box-shadow</span>: <span class="number">0</span> <span class="number">3px</span> <span class="number">8px</span> <span class="number">6px</span> <span class="built_in">rgba</span>(<span class="number">7</span>,<span class="number">17</span>,<span class="number">27</span>,<span class="number">0.09</span>);</span><br><span class="line">    <span class="attr">--card-hover-box-shadow</span>: <span class="number">0</span> <span class="number">3px</span> <span class="number">8px</span> <span class="number">6px</span> <span class="built_in">rgba</span>(<span class="number">7</span>,<span class="number">17</span>,<span class="number">27</span>,<span class="number">0.2</span>);</span><br><span class="line">    <span class="attr">--liushen-button-bg</span>: <span class="number">#30343f</span>;</span><br><span class="line">    <span class="attr">--liushen-button-hover-bg</span>: <span class="number">#2679cc</span>;</span><br><span class="line">    <span class="attr">--liushen-text</span>: <span class="built_in">rgba</span>(<span class="number">255</span>,<span class="number">255</span>,<span class="number">255</span>,<span class="number">0.702</span>);</span><br><span class="line">    <span class="attr">--liushen-fancybox-bg</span>: <span class="built_in">rgba</span>(<span class="number">0</span>,<span class="number">0</span>,<span class="number">0</span>,<span class="number">0.5</span>);</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 卡片初始化 */</span></span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> {</span><br><span class="line">    <span class="attribute">width</span>: <span class="built_in">calc</span>(<span class="number">33.333%</span> - <span class="number">6px</span>);</span><br><span class="line">    <span class="attribute">background</span>: <span class="built_in">var</span>(--liushen-card-bg);</span><br><span class="line">    <span class="attribute">border</span>: <span class="built_in">var</span>(--liushen-card-border);</span><br><span class="line">    <span class="attribute">box-shadow</span>: <span class="built_in">var</span>(--card-box-shadow);</span><br><span class="line">    <span class="attribute">transition</span>: box-shadow .<span class="number">3s</span> ease-in-out;</span><br><span class="line">    <span class="attribute">border-radius</span>: <span class="number">12px</span>;</span><br><span class="line">    <span class="attribute">display</span>: flex;</span><br><span class="line">    <span class="attribute">flex-direction</span>: column;</span><br><span class="line">    <span class="attribute">padding</span>: <span class="number">20px</span>;</span><br><span class="line">    <span class="attribute">margin-bottom</span>: <span class="number">9px</span>;</span><br><span class="line">    <span class="attribute">margin-right</span>: <span class="number">9px</span>;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span><span class="selector-pseudo">:hover</span> {</span><br><span class="line">    <span class="attribute">box-shadow</span>: <span class="built_in">var</span>(--card-hover-box-shadow);</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">@media</span> (<span class="attribute">max-width</span>: <span class="number">900px</span>) {</span><br><span class="line">    <span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> {</span><br><span class="line">      <span class="attribute">width</span>: <span class="built_in">calc</span>(<span class="number">50%</span> - <span class="number">5px</span>);</span><br><span class="line">    }</span><br><span class="line">}</span><br><span class="line"><span class="keyword">@media</span> (<span class="attribute">max-width</span>: <span class="number">450px</span>) {</span><br><span class="line">    <span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> {</span><br><span class="line">      <span class="attribute">width</span>: <span class="built_in">calc</span>(<span class="number">100%</span>);</span><br><span class="line">    }</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-id">#talk</span>{</span><br><span class="line">    <span class="attribute">position</span>: relative;</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">    <span class="attribute">box-sizing</span>: border-box;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_meta</span> <span class="selector-class">.avatar</span> {</span><br><span class="line">    <span class="attribute">margin</span>: <span class="number">0</span> <span class="meta">!important</span>;</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">60px</span>;</span><br><span class="line">    <span class="attribute">height</span>: <span class="number">60px</span>;</span><br><span class="line">    <span class="attribute">border-radius</span>: <span class="number">12px</span>;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_bottom</span>,</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_meta</span> {</span><br><span class="line">    <span class="attribute">display</span>: flex;</span><br><span class="line">    <span class="attribute">align-items</span>: center;    </span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_meta</span> {</span><br><span class="line">    <span class="attribute">display</span>: flex;</span><br><span class="line">    <span class="attribute">align-items</span>: center;</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">    <span class="attribute">padding-bottom</span>: <span class="number">10px</span>;</span><br><span class="line">    <span class="attribute">border-bottom</span>: <span class="number">1px</span> dashed grey; <span class="comment">/* 添加灰色虚线边框 */</span></span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_bottom</span> {</span><br><span class="line">    <span class="attribute">margin-top</span>: <span class="number">15px</span>;</span><br><span class="line">    <span class="attribute">padding-top</span>: <span class="number">10px</span>;</span><br><span class="line">    <span class="attribute">border-top</span>: <span class="number">1px</span> dashed grey; <span class="comment">/* 添加灰色虚线边框 */</span></span><br><span class="line">    <span class="attribute">justify-content</span>: space-between;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_meta</span> <span class="selector-class">.info</span> {</span><br><span class="line">    <span class="attribute">display</span>: flex;</span><br><span class="line">    <span class="attribute">flex-direction</span>: column;</span><br><span class="line">    <span class="attribute">margin-left</span>: <span class="number">10px</span>;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_meta</span> <span class="selector-class">.info</span> <span class="selector-class">.talk_nick</span> {</span><br><span class="line">    <span class="attribute">color</span>: <span class="number">#6dbdc3</span>;</span><br><span class="line">    <span class="attribute">font-size</span>: <span class="number">1.2rem</span>;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_meta</span> <span class="selector-class">.info</span> <span class="selector-tag">svg</span><span class="selector-class">.is-badge</span><span class="selector-class">.icon</span> {</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">15px</span>;</span><br><span class="line">    <span class="attribute">padding-top</span>: <span class="number">3px</span>;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_meta</span> <span class="selector-class">.info</span> <span class="selector-tag">span</span><span class="selector-class">.talk_date</span> {</span><br><span class="line">    <span class="attribute">opacity</span>: .<span class="number">6</span>;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_content</span> {</span><br><span class="line">    <span class="attribute">margin-top</span>: <span class="number">10px</span>;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_content</span> <span class="selector-class">.zone_imgbox</span> {</span><br><span class="line">    <span class="attribute">display</span>: flex;</span><br><span class="line">    <span class="attribute">flex-wrap</span>: wrap;</span><br><span class="line">    <span class="attr">--w</span>: <span class="built_in">calc</span>(<span class="number">25%</span> - <span class="number">8px</span>);</span><br><span class="line">    <span class="attribute">gap</span>: <span class="number">10px</span>;</span><br><span class="line">    <span class="attribute">margin-top</span>: <span class="number">10px</span>;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_content</span> <span class="selector-class">.zone_imgbox</span> <span class="selector-tag">a</span> {</span><br><span class="line">    <span class="attribute">display</span>: block;</span><br><span class="line">    <span class="attribute">border-radius</span>: <span class="number">12px</span>;</span><br><span class="line">    <span class="attribute">width</span>: <span class="built_in">var</span>(--w);</span><br><span class="line">    <span class="attribute">aspect-ratio</span>: <span class="number">1</span>/<span class="number">1</span>;</span><br><span class="line">    <span class="attribute">position</span>: relative;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_content</span> <span class="selector-class">.zone_imgbox</span> <span class="selector-tag">a</span><span class="selector-pseudo">:first-child</span> {</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">    <span class="attribute">aspect-ratio</span>: <span class="number">1.8</span>;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_content</span> <span class="selector-class">.zone_imgbox</span> <span class="selector-tag">img</span> {</span><br><span class="line">    <span class="attribute">border-radius</span>: <span class="number">10px</span>;</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">    <span class="attribute">height</span>: <span class="number">100%</span>;</span><br><span class="line">    <span class="attribute">margin</span>: <span class="number">0</span> <span class="meta">!important</span>;</span><br><span class="line">    <span class="attribute">object-fit</span>: cover;</span><br><span class="line">}</span><br><span class="line"><span class="comment">/* 底部 */</span></span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_bottom</span> {</span><br><span class="line">    <span class="attribute">opacity</span>: .<span class="number">9</span>;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_bottom</span> <span class="selector-class">.icon</span> {</span><br><span class="line">    <span class="attribute">float</span>: right;</span><br><span class="line">    <span class="attribute">transition</span>: all .<span class="number">3s</span>;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_bottom</span> <span class="selector-class">.icon</span><span class="selector-pseudo">:hover</span> {</span><br><span class="line">    <span class="attribute">color</span>: <span class="number">#49b1f5</span>;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_bottom</span> <span class="selector-tag">span</span><span class="selector-class">.talk_tag</span>,</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_bottom</span> <span class="selector-tag">span</span><span class="selector-class">.location_tag</span> {</span><br><span class="line">    <span class="attribute">font-size</span>: <span class="number">14px</span>;</span><br><span class="line">    <span class="attribute">background-color</span>: <span class="built_in">var</span>(--liushen-card-secondbg);</span><br><span class="line">    <span class="attribute">border-radius</span>: <span class="number">12px</span>;</span><br><span class="line">    <span class="attribute">padding</span>: <span class="number">3px</span> <span class="number">15px</span> <span class="number">3px</span> <span class="number">10px</span>;</span><br><span class="line">    <span class="attribute">transition</span>: box-shadow <span class="number">0.3s</span> ease;</span><br><span class="line">    <span class="attribute">box-shadow</span>: <span class="number">0</span> <span class="number">2px</span> <span class="number">4px</span> <span class="built_in">rgba</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0.1</span>);</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_bottom</span> <span class="selector-tag">span</span><span class="selector-class">.location_tag</span> {</span><br><span class="line">    <span class="attribute">margin-left</span>: <span class="number">5px</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_bottom</span> <span class="selector-tag">span</span><span class="selector-class">.talk_tag</span><span class="selector-pseudo">:hover</span>,</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_bottom</span> <span class="selector-tag">span</span><span class="selector-class">.location_tag</span><span class="selector-pseudo">:hover</span> {</span><br><span class="line">    <span class="attribute">box-shadow</span>: <span class="number">0</span> <span class="number">4px</span> <span class="number">8px</span> <span class="built_in">rgba</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0.3</span>);</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_content</span>&gt;<span class="selector-tag">a</span> {</span><br><span class="line">    <span class="attribute">margin</span>: <span class="number">0</span> <span class="number">3px</span>;</span><br><span class="line">    <span class="attribute">color</span>: <span class="number">#ff7d73</span> <span class="meta">!important</span>;</span><br><span class="line">}</span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_content</span>&gt;<span class="selector-tag">a</span><span class="selector-pseudo">:hover</span>{</span><br><span class="line">    <span class="attribute">text-decoration</span>: none <span class="meta">!important</span>;</span><br><span class="line">    <span class="attribute">color</span>: <span class="number">#ff5143</span> <span class="meta">!important</span></span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">@media</span> screen <span class="keyword">and</span> (<span class="attribute">max-width</span>: <span class="number">900px</span>) {</span><br><span class="line">    <span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_content</span> <span class="selector-class">.zone_imgbox</span> {</span><br><span class="line">        <span class="attr">--w</span>: <span class="built_in">calc</span>(<span class="number">33%</span> - <span class="number">5px</span>);</span><br><span class="line">    }</span><br><span class="line">    <span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-id">#post-comment</span>{</span><br><span class="line">        <span class="attribute">margin</span>: <span class="number">0</span> <span class="number">3px</span></span><br><span class="line">    }</span><br><span class="line">}</span><br><span class="line"><span class="keyword">@media</span> screen <span class="keyword">and</span> (<span class="attribute">max-width</span>: <span class="number">768px</span>) {</span><br><span class="line">    <span class="selector-class">.zone_imgbox</span> {</span><br><span class="line">        <span class="attribute">gap</span>: <span class="number">6px</span>;</span><br><span class="line">    }</span><br><span class="line">    <span class="selector-class">.zone_imgbox</span> {</span><br><span class="line">        <span class="attr">--w</span>: <span class="built_in">calc</span>(<span class="number">50%</span> - <span class="number">3px</span>);</span><br><span class="line">    }</span><br><span class="line">    <span class="selector-tag">span</span><span class="selector-class">.talk_date</span> {</span><br><span class="line">        <span class="attribute">font-size</span>: <span class="number">14px</span>;</span><br><span class="line">    }</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_content</span> <span class="selector-class">.douban-card</span> {</span><br><span class="line">    <span class="attribute">margin-top</span>: <span class="number">10px</span> <span class="meta">!important</span>;</span><br><span class="line">    <span class="attribute">text-decoration</span>: none;</span><br><span class="line">    <span class="attribute">align-items</span>: center;</span><br><span class="line">    <span class="attribute">border-radius</span>: <span class="number">12px</span>;</span><br><span class="line">    <span class="attribute">color</span>: <span class="number">#faebd7</span>;</span><br><span class="line">    <span class="attribute">display</span>: flex;</span><br><span class="line">    <span class="attribute">justify-content</span>: center;</span><br><span class="line">    <span class="attribute">margin</span>: <span class="number">10px</span>;</span><br><span class="line">    <span class="attribute">max-width</span>: <span class="number">400px</span>;</span><br><span class="line">    <span class="attribute">overflow</span>: hidden;</span><br><span class="line">    <span class="attribute">padding</span>: <span class="number">15px</span>;</span><br><span class="line">    <span class="attribute">position</span>: relative;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.douban-card</span> <span class="selector-class">.douban-card-bgimg</span> {</span><br><span class="line">    <span class="attribute">background-position</span>: <span class="number">50%</span>;</span><br><span class="line">    <span class="attribute">background-repeat</span>: no-repeat;</span><br><span class="line">    <span class="attribute">background-size</span>: <span class="number">100%</span>;</span><br><span class="line">    <span class="attribute">filter</span>: <span class="built_in">blur</span>(<span class="number">15px</span>) <span class="built_in">brightness</span>(.<span class="number">6</span>);</span><br><span class="line">    <span class="attribute">height</span>: <span class="number">115%</span>;</span><br><span class="line">    <span class="attribute">position</span>: absolute;</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">115%</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.douban-card</span> <span class="selector-class">.douban-card-left</span> {</span><br><span class="line">    <span class="attribute">align-items</span>: center;</span><br><span class="line">    <span class="attribute">display</span>: flex;</span><br><span class="line">    <span class="attribute">flex-direction</span>: column;</span><br><span class="line">    <span class="attribute">position</span>: relative;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.douban-card</span> <span class="selector-class">.douban-card-left</span> <span class="selector-class">.douban-card-img</span> {</span><br><span class="line">    <span class="attribute">transition</span>: all .<span class="number">5s</span> ease;</span><br><span class="line">    <span class="attribute">height</span>: <span class="number">130px</span>;</span><br><span class="line">    <span class="attribute">position</span>: relative;</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">80px</span>;</span><br><span class="line">    <span class="attribute">background-position</span>: <span class="number">50%</span>;</span><br><span class="line">    <span class="attribute">background-repeat</span>: no-repeat;</span><br><span class="line">    <span class="attribute">background-size</span>: <span class="number">100%</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.douban-card</span> <span class="selector-class">.douban-card-left</span><span class="selector-pseudo">:hover</span> <span class="selector-class">.douban-card-img</span> {</span><br><span class="line">    <span class="attribute">filter</span>: <span class="built_in">blur</span>(<span class="number">5px</span>) <span class="built_in">brightness</span>(.<span class="number">6</span>);</span><br><span class="line">    <span class="attribute">transform</span>: <span class="built_in">perspective</span>(<span class="number">800px</span>) <span class="built_in">rotateX</span>(<span class="number">180deg</span>);</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.douban-card</span> <span class="selector-class">.douban-card-right</span> {</span><br><span class="line">    <span class="attribute">color</span>: <span class="number">#faebd7</span>;</span><br><span class="line">    <span class="attribute">display</span>: flex;</span><br><span class="line">    <span class="attribute">flex-direction</span>: column;</span><br><span class="line">    <span class="attribute">font-size</span>: <span class="number">14px</span>;</span><br><span class="line">    <span class="attribute">line-height</span>: <span class="number">1.5</span>;</span><br><span class="line">    <span class="attribute">margin-left</span>: <span class="number">12px</span>;</span><br><span class="line">    <span class="attribute">position</span>: relative;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.douban-card</span> <span class="selector-class">.douban-card-right</span> <span class="selector-class">.douban-card-item</span>  {</span><br><span class="line">    <span class="attribute">margin-top</span>: <span class="number">4px</span>;</span><br><span class="line">    <span class="attribute">max-width</span>: <span class="number">95%</span>;</span><br><span class="line">    <span class="attribute">overflow</span>: hidden;</span><br><span class="line">    <span class="attribute">text-overflow</span>: ellipsis;</span><br><span class="line">    <span class="attribute">white-space</span>: nowrap;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 外链卡片 */</span></span><br><span class="line"><span class="selector-id">#talk</span> <span class="selector-class">.talk_item</span> <span class="selector-class">.talk_content</span> <span class="selector-class">.shuoshuo-external-link</span> {</span><br><span class="line">    <span class="comment">/* 无下划线 */</span></span><br><span class="line">    <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">    <span class="attribute">height</span>: <span class="number">80px</span>;</span><br><span class="line">    <span class="attribute">margin-top</span>: <span class="number">10px</span>;</span><br><span class="line">    <span class="attribute">border-radius</span>: <span class="number">12px</span>;</span><br><span class="line">    <span class="attribute">background-color</span>: <span class="built_in">var</span>(--liushen-card-secondbg);</span><br><span class="line">    <span class="attribute">color</span>: <span class="built_in">var</span>(--liushen-card-text);</span><br><span class="line">    <span class="attribute">border</span>: <span class="built_in">var</span>(--liushen-card-border);</span><br><span class="line">    <span class="attribute">transition</span>: background-color .<span class="number">3s</span> ease-in-out;    </span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.shuoshuo-external-link</span><span class="selector-pseudo">:hover</span> {</span><br><span class="line">    <span class="attribute">background-color</span>: <span class="built_in">var</span>(--liushen-button-hover-bg);</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.shuoshuo-external-link</span> <span class="selector-class">.external-link</span> {</span><br><span class="line">    <span class="attribute">display</span>: flex;</span><br><span class="line">    <span class="attribute">color</span>: <span class="built_in">var</span>(--liushen-text) <span class="meta">!important</span>;</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">    <span class="attribute">height</span>: <span class="number">100%</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.shuoshuo-external-link</span> <span class="selector-class">.external-link</span><span class="selector-pseudo">:hover</span> {</span><br><span class="line">    <span class="attribute">color</span>: white <span class="meta">!important</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.shuoshuo-external-link</span> <span class="selector-class">.external-link</span><span class="selector-pseudo">:hover</span> {</span><br><span class="line">    <span class="attribute">text-decoration</span>: none <span class="meta">!important</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.shuoshuo-external-link</span> <span class="selector-class">.external-link-left</span> {</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">60px</span>;</span><br><span class="line">    <span class="attribute">height</span>: <span class="number">60px</span>;</span><br><span class="line">    <span class="attribute">margin</span>: <span class="number">10px</span>;</span><br><span class="line">    <span class="attribute">border-radius</span>: <span class="number">12px</span>;</span><br><span class="line">    <span class="attribute">background-size</span>: cover;</span><br><span class="line">    <span class="attribute">background-position</span>: center;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.shuoshuo-external-link</span> <span class="selector-class">.external-link-right</span> {</span><br><span class="line">    <span class="attribute">display</span>: flex;</span><br><span class="line">    <span class="attribute">flex-direction</span>: column;</span><br><span class="line">    <span class="attribute">justify-content</span>: center;</span><br><span class="line">    <span class="attribute">width</span>: <span class="built_in">calc</span>(<span class="number">100%</span> - <span class="number">80px</span>);</span><br><span class="line">    <span class="attribute">padding</span>: <span class="number">10px</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.shuoshuo-external-link</span> <span class="selector-class">.external-link-right</span> <span class="selector-class">.external-link-title</span> {</span><br><span class="line">    <span class="attribute">font-size</span>: <span class="number">1.0rem</span>;</span><br><span class="line">    <span class="attribute">font-weight</span>: <span class="number">800</span>;</span><br><span class="line">    <span class="attribute">white-space</span>: nowrap;</span><br><span class="line">    <span class="attribute">overflow</span>: hidden;</span><br><span class="line">    <span class="attribute">text-overflow</span>: ellipsis;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.shuoshuo-external-link</span> <span class="selector-class">.external-link-right</span> <span class="selector-tag">i</span> {</span><br><span class="line">    <span class="attribute">margin-left</span>: <span class="number">5px</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.limit</span> {</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">    <span class="attribute">text-align</span>: center;</span><br><span class="line">    <span class="attribute">margin-top</span>: <span class="number">30px</span>;</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure><p>如果一切正常，应该就可以显示了，如果仍然有问题可以评论区讨论，我们在这里继续进行下一步：</p><h4 id="首页轮播"><a href="#首页轮播" class="headerlink" title="首页轮播"></a>首页轮播</h4><p>本次修改我还修改了首页轮播部分的内容，由于请求的地址一致，这里我直接用了同一个缓存，可以使网站的加载速度更近一步，缓存时间为半个小时，缓存位置为<code>localstorage</code>，缓存数据共30条，由于首页的轮播只需要最新的内容，这里我们取到缓存后节选前五条即可。</p><p>在主题配置文件内部引入外部<code>js</code>，名称位置随意，内容如下：</p><figure class="highlight javascript"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">let</span> talkTimer = <span class="literal">null</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">const</span> cacheKey = <span class="string">'talksCache'</span>;</span><br><span class="line"><span class="keyword">const</span> cacheTimeKey = <span class="string">'talksCacheTime'</span>;</span><br><span class="line"><span class="keyword">const</span> cacheDuration = <span class="number">30</span> * <span class="number">60</span> * <span class="number">1000</span>; <span class="comment">// 缓存有效期 30分钟</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">function</span> <span class="title function_">indexTalk</span>(<span class="params"></span>) {</span><br><span class="line">    <span class="keyword">if</span> (talkTimer) {</span><br><span class="line">        <span class="built_in">clearInterval</span>(talkTimer);</span><br><span class="line">        talkTimer = <span class="literal">null</span>;</span><br><span class="line">    }</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> (!<span class="variable language_">document</span>.<span class="title function_">getElementById</span>(<span class="string">'bber-talk'</span>)) <span class="keyword">return</span>;</span><br><span class="line"></span><br><span class="line">    <span class="keyword">function</span> <span class="title function_">toText</span>(<span class="params">ls</span>) {</span><br><span class="line">        <span class="keyword">let</span> text = [];</span><br><span class="line">        ls.<span class="title function_">forEach</span>(<span class="function"><span class="params">item</span> =&gt;</span> {</span><br><span class="line">            text.<span class="title function_">push</span>(item.<span class="property">content</span>.<span class="title function_">replace</span>(<span class="regexp">/#(.*?)\s/g</span>, <span class="string">''</span>).<span class="title function_">replace</span>(<span class="regexp">/\{(.*?)\}/g</span>, <span class="string">''</span>).<span class="title function_">replace</span>(<span class="regexp">/\!\[(.*?)\]\((.*?)\)/g</span>, <span class="string">'&lt;i class="fa-solid fa-image"&gt;&lt;/i&gt;'</span>).<span class="title function_">replace</span>(<span class="regexp">/\[(.*?)\]\((.*?)\)/g</span>, <span class="string">'&lt;i class="fa-solid fa-link"&gt;&lt;/i&gt;'</span>));</span><br><span class="line">        });</span><br><span class="line">        <span class="keyword">return</span> text;</span><br><span class="line">    }</span><br><span class="line"></span><br><span class="line">    <span class="keyword">function</span> <span class="title function_">talk</span>(<span class="params">ls</span>) {</span><br><span class="line">        <span class="keyword">let</span> html = <span class="string">''</span>;</span><br><span class="line">        ls.<span class="title function_">forEach</span>(<span class="function">(<span class="params">item, i</span>) =&gt;</span> { html += <span class="string">`&lt;li class="item item-<span class="subst">${i + <span class="number">1</span>}</span>"&gt;<span class="subst">${item}</span>&lt;/li&gt;`</span> });</span><br><span class="line">        <span class="keyword">let</span> box = <span class="variable language_">document</span>.<span class="title function_">querySelector</span>(<span class="string">"#bber-talk .talk-list"</span>);</span><br><span class="line">        box.<span class="property">innerHTML</span> = html;</span><br><span class="line">        talkTimer = <span class="built_in">setInterval</span>(<span class="function">() =&gt;</span> {</span><br><span class="line">            box.<span class="title function_">appendChild</span>(box.<span class="property">children</span>[<span class="number">0</span>]);</span><br><span class="line">        }, <span class="number">3000</span>);</span><br><span class="line">    }</span><br><span class="line"></span><br><span class="line">    <span class="keyword">const</span> cachedData = <span class="variable language_">localStorage</span>.<span class="title function_">getItem</span>(cacheKey);</span><br><span class="line">    <span class="keyword">const</span> cachedTime = <span class="variable language_">localStorage</span>.<span class="title function_">getItem</span>(cacheTimeKey);</span><br><span class="line">    <span class="keyword">const</span> currentTime = <span class="keyword">new</span> <span class="title class_">Date</span>().<span class="title function_">getTime</span>();</span><br><span class="line"></span><br><span class="line">    <span class="comment">// 判断缓存是否有效</span></span><br><span class="line">    <span class="keyword">if</span> (cachedData &amp;&amp; cachedTime &amp;&amp; (currentTime - cachedTime &lt; cacheDuration)) {</span><br><span class="line">        <span class="keyword">const</span> data = <span class="title function_">toText</span>(<span class="title class_">JSON</span>.<span class="title function_">parse</span>(cachedData));</span><br><span class="line">        <span class="title function_">talk</span>(data.<span class="title function_">slice</span>(<span class="number">0</span>, <span class="number">6</span>)); <span class="comment">// 使用缓存渲染数据</span></span><br><span class="line">    } <span class="keyword">else</span> {</span><br><span class="line">        <span class="title function_">fetch</span>(<span class="string">'https://mm.liushen.fun/api/memo/list'</span>, {  <span class="comment">// 使用新的API地址</span></span><br><span class="line">            <span class="attr">method</span>: <span class="string">'POST'</span>,</span><br><span class="line">            <span class="attr">headers</span>: { <span class="string">'Content-Type'</span>: <span class="string">'application/json'</span> },</span><br><span class="line">            <span class="attr">body</span>: <span class="title class_">JSON</span>.<span class="title function_">stringify</span>({ <span class="attr">size</span>: <span class="number">30</span> })  <span class="comment">// 限制30条数据</span></span><br><span class="line">        })</span><br><span class="line">        .<span class="title function_">then</span>(<span class="function"><span class="params">res</span> =&gt;</span> res.<span class="title function_">json</span>())</span><br><span class="line">        .<span class="title function_">then</span>(<span class="function"><span class="params">data</span> =&gt;</span> {</span><br><span class="line">            <span class="comment">// 确保新的API返回数据格式正确</span></span><br><span class="line">            <span class="keyword">if</span> (data.<span class="property">code</span> === <span class="number">0</span> &amp;&amp; data.<span class="property">data</span> &amp;&amp; <span class="title class_">Array</span>.<span class="title function_">isArray</span>(data.<span class="property">data</span>.<span class="property">list</span>)) {</span><br><span class="line">                <span class="variable language_">localStorage</span>.<span class="title function_">setItem</span>(cacheKey, <span class="title class_">JSON</span>.<span class="title function_">stringify</span>(data.<span class="property">data</span>.<span class="property">list</span>));</span><br><span class="line">                <span class="variable language_">localStorage</span>.<span class="title function_">setItem</span>(cacheTimeKey, currentTime.<span class="title function_">toString</span>());</span><br><span class="line">                </span><br><span class="line">                <span class="keyword">const</span> formattedData = <span class="title function_">toText</span>(data.<span class="property">data</span>.<span class="property">list</span>);  <span class="comment">// 处理数据格式</span></span><br><span class="line">                <span class="title function_">talk</span>(formattedData.<span class="title function_">slice</span>(<span class="number">0</span>, <span class="number">6</span>));  <span class="comment">// 渲染数据</span></span><br><span class="line">            }</span><br><span class="line">        })</span><br><span class="line">        .<span class="title function_">catch</span>(<span class="function"><span class="params">error</span> =&gt;</span> <span class="variable language_">console</span>.<span class="title function_">error</span>(<span class="string">'Error fetching data:'</span>, error));</span><br><span class="line">    }</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="comment">// pjax注释掉上面的 indexTalk(); 使用如下方法：</span></span><br><span class="line"><span class="keyword">function</span> <span class="title function_">whenDOMReady</span>(<span class="params"></span>) {</span><br><span class="line">    <span class="title function_">indexTalk</span>();</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="title function_">whenDOMReady</span>();</span><br><span class="line"><span class="variable language_">document</span>.<span class="title function_">addEventListener</span>(<span class="string">"pjax:complete"</span>, whenDOMReady);</span><br></pre></td></tr></tbody></table></figure><p>注意自行修改其中第42行的<code>API</code>地址为你自己的。</p><p>然后在主题文件中添加以下的样式：</p><figure class="highlight css"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/* maintop */</span></span><br><span class="line"></span><br><span class="line"><span class="selector-id">#main_top</span> {</span><br><span class="line">  <span class="attribute">display</span>: flex;</span><br><span class="line">  <span class="attribute">justify-content</span>: center;</span><br><span class="line">  <span class="attribute">z-index</span>: <span class="number">1</span>;</span><br><span class="line">  <span class="attribute">max-width</span>: <span class="number">1200px</span>;</span><br><span class="line">  <span class="attribute">margin</span>: <span class="number">20px</span> auto;</span><br><span class="line">  <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">0</span> <span class="number">15px</span>;</span><br><span class="line">  <span class="attribute">margin-top</span>: <span class="number">40px</span>;</span><br><span class="line">  <span class="attribute">margin-bottom</span>: <span class="number">0px</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.hide-aside</span> <span class="selector-id">#main_top</span> {</span><br><span class="line">  <span class="attribute">width</span>: <span class="number">80%</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-class">.hide-aside</span> <span class="selector-id">#main_top</span> <span class="selector-id">#bber-talk</span> {</span><br><span class="line">  <span class="attribute">max-width</span>: <span class="number">936px</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">@media</span> screen <span class="keyword">and</span> (<span class="attribute">min-width</span>: <span class="number">2000px</span>) {</span><br><span class="line">  <span class="selector-class">.hide-aside</span> <span class="selector-id">#main_top</span> <span class="selector-id">#bber-talk</span> {</span><br><span class="line">    <span class="attribute">max-width</span>: <span class="number">80%</span>;</span><br><span class="line">  }</span><br><span class="line"></span><br><span class="line">  <span class="selector-id">#main_top</span> {</span><br><span class="line">    <span class="attribute">max-width</span>: <span class="number">70%</span>;</span><br><span class="line">  }</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">@media</span> screen <span class="keyword">and</span> (<span class="attribute">max-width</span>: <span class="number">1210px</span>) {</span><br><span class="line">  <span class="selector-class">.hide-aside</span> <span class="selector-id">#main_top</span> {</span><br><span class="line">    <span class="attribute">padding</span>: <span class="number">0</span> <span class="number">12px</span>;</span><br><span class="line">  }</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">@media</span> screen <span class="keyword">and</span> (<span class="attribute">max-width</span>: <span class="number">900px</span>) {</span><br><span class="line">  <span class="selector-class">.hide-aside</span> <span class="selector-id">#main_top</span> {</span><br><span class="line">    <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">    <span class="attribute">padding</span>: <span class="number">0</span> <span class="number">15px</span>;</span><br><span class="line">  }</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">@media</span> screen <span class="keyword">and</span> (<span class="attribute">max-width</span>: <span class="number">768px</span>) {</span><br><span class="line">  <span class="selector-class">.hide-aside</span> <span class="selector-id">#main_top</span> {</span><br><span class="line">    <span class="attribute">padding</span>: <span class="number">0</span> <span class="number">5px</span>;</span><br><span class="line">  }</span><br><span class="line"></span><br><span class="line">  <span class="selector-tag">div</span><span class="selector-id">#main_top</span> {</span><br><span class="line">    <span class="attribute">margin-top</span>: <span class="number">20px</span>;</span><br><span class="line">    <span class="attribute">padding</span>: <span class="number">0</span> <span class="number">5px</span>;</span><br><span class="line">  }</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-id">#bber-talk</span> {</span><br><span class="line">  <span class="comment">/* border-radius: 8px; */</span></span><br><span class="line">  <span class="comment">/* background: var(--card-bg); */</span></span><br><span class="line">  <span class="comment">/* box-shadow: none; */</span></span><br><span class="line">  <span class="attribute">box-sizing</span>: border-box;</span><br><span class="line">  <span class="comment">/* transition: all .3s ease-in-out; */</span></span><br><span class="line">  <span class="attribute">cursor</span>: pointer;</span><br><span class="line">  <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">  <span class="attribute">min-height</span>: <span class="number">50px</span>;</span><br><span class="line">  <span class="attribute">padding</span>: .<span class="number">5rem</span> <span class="number">1rem</span>;</span><br><span class="line">  <span class="attribute">display</span>: flex;</span><br><span class="line">  <span class="attribute">align-items</span>: center;</span><br><span class="line">  <span class="attribute">overflow</span>: hidden;</span><br><span class="line">  <span class="attribute">font-weight</span>: <span class="number">700</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-id">#bber-talk</span>,</span><br><span class="line"><span class="selector-id">#bber-talk</span> <span class="selector-tag">a</span> {</span><br><span class="line">  <span class="attribute">color</span>: <span class="built_in">var</span>(--font-color);</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-id">#bber-talk</span> <span class="selector-tag">svg</span><span class="selector-class">.icon</span> {</span><br><span class="line">  <span class="attribute">width</span>: <span class="number">1em</span>;</span><br><span class="line">  <span class="attribute">height</span>: <span class="number">1em</span>;</span><br><span class="line">  <span class="attribute">vertical-align</span>: -.<span class="number">15em</span>;</span><br><span class="line">  <span class="attribute">fill</span>: currentColor;</span><br><span class="line">  <span class="attribute">overflow</span>: hidden;</span><br><span class="line">  <span class="attribute">font-size</span>: <span class="number">20px</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-id">#bber-talk</span> <span class="selector-class">.item</span> <span class="selector-tag">i</span> {</span><br><span class="line">  <span class="attribute">margin-left</span>: <span class="number">5px</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-id">#bber-talk</span> &gt; <span class="selector-tag">i</span> {</span><br><span class="line">  <span class="attribute">font-size</span>: <span class="number">1.1rem</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-id">#bber-talk</span> <span class="selector-class">.talk-list</span> {</span><br><span class="line">  <span class="attribute">flex</span>: <span class="number">1</span>;</span><br><span class="line">  <span class="attribute">max-height</span>: <span class="number">32px</span>;</span><br><span class="line">  <span class="attribute">font-size</span>: <span class="number">16px</span>;</span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">0</span>;</span><br><span class="line">  <span class="attribute">margin</span>: <span class="number">0</span>;</span><br><span class="line">  <span class="attribute">overflow</span>: hidden;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-id">#bber-talk</span> <span class="selector-class">.talk-list</span><span class="selector-pseudo">:hover</span> {</span><br><span class="line">  <span class="attribute">color</span>: <span class="built_in">var</span>(--default-bg-color);</span><br><span class="line">  <span class="attribute">transition</span>: all .<span class="number">2s</span> ease-in-out;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="selector-id">#bber-talk</span> <span class="selector-class">.talk-list</span> <span class="selector-tag">li</span> {</span><br><span class="line">  <span class="attribute">list-style</span>: none;</span><br><span class="line">  <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">  <span class="attribute">white-space</span>: nowrap;</span><br><span class="line">  <span class="attribute">text-overflow</span>: ellipsis;</span><br><span class="line">  <span class="attribute">overflow</span>: hidden;</span><br><span class="line">  <span class="attribute">margin-left</span>: <span class="number">10px</span>;</span><br><span class="line">}</span><br><span class="line"></span><br><span class="line"><span class="keyword">@media</span> screen <span class="keyword">and</span> (<span class="attribute">min-width</span>: <span class="number">770px</span>) {</span><br><span class="line">  <span class="selector-id">#bber-talk</span> <span class="selector-class">.talk-list</span> {</span><br><span class="line">    <span class="attribute">text-align</span>: center;</span><br><span class="line">    <span class="attribute">margin-right</span>: <span class="number">20px</span>;</span><br><span class="line">  }</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure><p>此时我们还缺少一个插入点，我们需要确保我们的轮播条在最顶部的位置轮播，创建文件<code>themes\butterfly\layout\includes\others\memos_home.pug</code>，写入以下内容：</p><figure class="highlight plaintext"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">if (is_home())</span><br><span class="line">  #main_top</span><br><span class="line">    #bber-talk.cardHover.bb_talk_swipper(onclick=`pjax.loadUrl("/shuoshuo/")`)</span><br><span class="line">      svg.icon(t='1660960757124', viewBox='0 0 1024 1024', version='1.1', xmlns='http://www.w3.org/2000/svg', p-id='3946', width='200', height='200')</span><br><span class="line">        path(d='M526.432 924.064c-20.96 0-44.16-12.576-68.96-37.344L274.752 704H192c-52.928 0-96-43.072-96-96V416c0-52.928 43.072-96 96-96h82.752l182.624-182.624c24.576-24.576 47.744-37.024 68.864-37.024C549.184 100.352 576 116 576 160v704c0 44.352-26.72 60.064-49.568 60.064zM192 384c-17.632 0-32 14.368-32 32v192c0 17.664 14.368 32 32 32h96c8.48 0 16.64 3.36 22.624 9.376l192.064 192.096c3.392 3.36 6.496 6.208 9.312 8.576V174.016a145.824 145.824 0 0 0-9.376 8.608l-192 192C304.64 380.64 296.48 384 288 384h-96zM687.584 730.368a31.898 31.898 0 0 1-18.656-6.016c-14.336-10.304-17.632-30.304-7.328-44.672l12.672-17.344C707.392 617.44 736 578.624 736 512c0-69.024-25.344-102.528-57.44-144.928-5.664-7.456-11.328-15.008-16.928-22.784-10.304-14.336-7.04-34.336 7.328-44.672 14.368-10.368 34.336-7.04 44.672 7.328 5.248 7.328 10.656 14.464 15.968 21.504C764.224 374.208 800 421.504 800 512c0 87.648-39.392 141.12-74.144 188.32l-12.224 16.736c-6.272 8.704-16.064 13.312-26.048 13.312z', p-id='3947')</span><br><span class="line">        path(d='M796.448 839.008a31.906 31.906 0 0 1-21.088-7.936c-13.28-11.648-14.624-31.872-2.976-45.152C836.608 712.672 896 628.864 896 512s-59.392-200.704-123.616-273.888c-11.648-13.312-10.304-33.504 2.976-45.184 13.216-11.648 33.44-10.336 45.152 2.944C889.472 274.56 960 373.6 960 512s-70.528 237.472-139.488 316.096c-6.368 7.232-15.2 10.912-24.064 10.912z', p-id='3948')</span><br><span class="line">      ul.talk-list 说说加载中。。。</span><br></pre></td></tr></tbody></table></figure><p>创建了元素，我们需要通过一个注入点引入这个文件，将其插入到主页中，打开文件<code>themes\butterfly\layout\includes\layout.pug</code>，按照下面的位置插入我们的文件引用：</p><figure class="highlight diff"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br></pre></td><td class="code"><pre><span class="line"><span class="deletion">- var htmlClassHideAside = theme.aside.enable &amp;&amp; theme.aside.hide ? 'hide-aside' : ''</span></span><br><span class="line"><span class="deletion">- page.aside = is_archive() ? theme.aside.display.archive: is_category() ? theme.aside.display.category : is_tag() ? theme.aside.display.tag : page.aside</span></span><br><span class="line"><span class="deletion">- var hideAside = !theme.aside.enable || page.aside === false ? 'hide-aside' : ''</span></span><br><span class="line"><span class="deletion">- var pageType = is_post() ? 'post' : 'page'</span></span><br><span class="line"><span class="deletion">- pageType = page.type ? pageType + ' type-' + page.type : pageType</span></span><br><span class="line"></span><br><span class="line">doctype html</span><br><span class="line">html(lang=config.language data-theme=theme.display_mode class=htmlClassHideAside)</span><br><span class="line">  head</span><br><span class="line">    include ./head.pug</span><br><span class="line">  body</span><br><span class="line">    if theme.preloader.enable</span><br><span class="line">      !=partial('includes/loading/index', {}, {cache: true})</span><br><span class="line"></span><br><span class="line">    if theme.background</span><br><span class="line">      #web_bg</span><br><span class="line"></span><br><span class="line">    !=partial('includes/sidebar', {}, {cache: true})</span><br><span class="line"></span><br><span class="line">    #body-wrap(class=pageType)</span><br><span class="line">      include ./header/index.pug</span><br><span class="line"><span class="addition">+     include ./others/memos_home.pug</span></span><br><span class="line"></span><br><span class="line">      main#content-inner.layout(class=hideAside)</span><br><span class="line">        if body</span><br><span class="line">          div!= body</span><br><span class="line">        else</span><br><span class="line">          block content</span><br><span class="line">          if theme.aside.enable &amp;&amp; page.aside !== false</span><br><span class="line">            include widget/index.pug</span><br><span class="line"></span><br><span class="line">      - const footerBg = theme.footer_img</span><br><span class="line">      - const footer_bg = footerBg ? footerBg <span class="comment">=== true ? bg_img : getBgPath(footerBg) : ''</span></span><br><span class="line">      footer#footer(style=footer_bg)</span><br><span class="line">        !=partial('includes/footer', {}, {cache: true})</span><br><span class="line"></span><br><span class="line">    include ./rightside.pug</span><br><span class="line">    !=partial('includes/rightmenu', {}, {cache: true})</span><br><span class="line">    include ./additional-js.pug</span><br></pre></td></tr></tbody></table></figure><p>添加第22行，注意不要抄前面的加号，缩进与上面的include对齐即可。这样我们的首页轮播也实现了，如果有样式不对的地方请自行微调。</p><h2 id="额外教程"><a href="#额外教程" class="headerlink" title="额外教程"></a>额外教程</h2><h3 id="Meting"><a href="#Meting" class="headerlink" title="Meting"></a>Meting</h3><p>由于<code>Moments</code>的音乐部分需要使用<code>MetingJS</code>，如果用默认的服务可能会很慢，非常影响速度，所以我建议自建，这里我找到的项目是：</p><div class="liushen-tag-link"><a class="tag-Link" target="_blank" href="/safego/?u=aHR0cHM6Ly9naXRodWIuY29tL3hpemV5b3VwYW4vTWV0aW5nLUFQSQ" rel="external nofollow noopener noreferrer"><div class="tag-link-tips">🙄引用站外地址，不保证站点的可用性和安全性</div><div class="tag-link-bottom"><div class="tag-link-left" style="background-image:url(https://p.liiiu.cn/i/2024/07/27/66a461a3098aa.webp)"></div><div class="tag-link-right"><div class="tag-link-title">Meting-API：Meting API 的容器化与部署</div><div class="tag-link-sitename">github.com@xizeyoupan</div></div><i class="fa-solid fa-angle-right"></i></div></a></div><p>这个项目支持多种部署方式，除了源码部署，还可以通过<code>Docker</code>部署，<code>Deno</code>平台部署以及<code>Vercel</code>一键部署，速度上大家自行判断。</p><p>由于作者使用的为轻量化框架<code>Deno</code>，对于<code>X-Forwarded</code>请求头或<code>transparent proxy</code>并不支持，所以实际有用的只有<code>X-Forwarded-Host</code>请求头，我们需要将<code>/meting</code>的流量都转发到<code>/</code>上，我们需要自己修改<code>Nginx</code>配置文件，这里官方是有介绍的，只需要在<code>Nginx</code>配置文件中添加一个转发即可，详情请见上方链接，这里我只说明雷池的修改方式：</p><p>首先在终端中<code>cd</code>到目录<code>/data/safeline/resources/nginx/custom_params</code>，通过<code>vim</code>打开对应的配置文件，比如这里我对应的配置文件ID为49：</p><figure class="highlight bash"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">root@VM-4-11-ubuntu:/home/ubuntu# <span class="built_in">cd</span> /data/safeline/resources/nginx/custom_params</span><br><span class="line">root@VM-4-11-ubuntu:/data/safeline/resources/nginx/custom_params# vi ./backend_49</span><br></pre></td></tr></tbody></table></figure><p>在打开的<code>vim</code>窗口中，点击字母<code>i</code>，输入以下的内容：</p><figure class="highlight nginx"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">location</span><span class="regexp"> ^~</span> /meting/ {</span><br><span class="line">    <span class="attribute">proxy_pass</span> http://[你的源地址IP]:3040/;</span><br><span class="line">    <span class="attribute">proxy_set_header</span> X-Forwarded-Host <span class="variable">$scheme</span>://<span class="variable">$host</span>:<span class="variable">$server_port</span>/meting;</span><br><span class="line">}</span><br></pre></td></tr></tbody></table></figure><p>输入完成后，点击<code>esc</code>，输入<code>:wq</code>强制保存并退出。</p><p>同样通过以下命令检查并重启<code>Nginx</code>：</p><figure class="highlight bash"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">root@VM-4-11-ubuntu:/data/safeline/resources/nginx/custom_params# docker <span class="built_in">exec</span> safeline-tengine nginx -t</span><br><span class="line">nginx: the configuration file /etc/nginx/nginx.conf syntax is ok</span><br><span class="line">nginx: configuration file /etc/nginx/nginx.conf <span class="built_in">test</span> is successful</span><br><span class="line">root@VM-4-11-ubuntu:/data/safeline/resources/nginx/custom_params# docker <span class="built_in">exec</span> safeline-tengine nginx -s reload</span><br><span class="line">root@VM-4-11-ubuntu:/data/safeline/resources/nginx/custom_params#</span><br></pre></td></tr></tbody></table></figure><p>重启应该就实现效果了，但是访问根目录可能并没有变<code>https</code>，因为我们这里的配置是将<code>/meting</code>的数据发送到根域名并采用<code>https</code>，所以在音乐页面，我们可以填写的<code>api</code>地址如下：</p><figure class="highlight txt"><table><tbody><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://meting.example.com/meting/api?server=:server&amp;type=:type&amp;id=:id&amp;r=:r</span><br></pre></td></tr></tbody></table></figure><p>保存后应该就可以看到后台没有<code>http</code>访问的报错和警告了。</p><div class="note note-info"><div class="note-header"><i class="note-icon fa-regular fa-circle-check"></i> <span class="note-title">编辑工具说明</span></div><div class="note-content"><p>当然这里的编辑工具可以使任何可以编辑的页面，可视化是最方便的，这里是由于腾讯云无法通过<code>root</code>直接登录，打开的可视化界面权限不够，所以我选择在页面中使用管理员权限打开<code>vim</code>进行编辑。</p></div></div><h3 id="S3配置"><a href="#S3配置" class="headerlink" title="S3配置"></a>S3配置</h3><div class="note note-info"><div class="note-header"><i class="note-icon fa-regular fa-circle-check"></i> <span class="note-title">笨蛋声明</span></div><div class="note-content"><p>这里我感觉稍微有点卡顿，如果错误配置可能会影响使用（可能是我太笨了QAQ），所以稍微记录一下，也希望能给别人提供一些帮助。</p></div></div><p>在<code>S3</code>上我选择缤纷云，每个月有<code>10GB</code>流量免费额度，和<code>50GB</code>存储免费额度，放在轻量朋友圈上是包用不完的，首先创建一个存储桶，如果你不打算绑定外部地址，那就选择公开桶，但是经过测试公开桶需要余额大于零。如果你打算绑定备案域名，那就不需要公开桶，然后配置好权限访问后，如果师公开桶，你会得到一个桶的域名，比如缤纷云的话，一般格式为<code>https://你的桶名称.s3.bitiful.net</code>，这个就是你图片直链的域名。</p><div class="liushen-tag-link"><a class="tag-Link" target="_blank" href="/safego/?u=aHR0cHM6Ly93d3cuYml0aWZ1bC5jb20v" rel="external nofollow noopener noreferrer"><div class="tag-link-tips">🙄引用站外地址，不保证站点的可用性和安全性</div><div class="tag-link-bottom"><div class="tag-link-left" style="background-image:url(https://p.liiiu.cn/i/2024/07/27/66a4632bbf06e.webp)"></div><div class="tag-link-right"><div class="tag-link-title">缤纷云：高性能对象存储+CDN</div><div class="tag-link-sitename">七牛云存储与OSS的优秀替代品，以不到1/3的成本减轻成本负担并释放你的创造力。</div></div><i class="fa-solid fa-angle-right"></i></div></a></div><p>如果你打算自行绑定域名到桶，那就是自己的域名了，然后去左边对象存储的<code>AccessKey</code>中创建一个子用户，你会获得一个子用户<code>AccessKey</code>和<code>SecretKey</code>.</p><p>回到<code>Moments</code>后台的<code>S3</code>配置中，按照下图进行配置：</p><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/02/18/67b452089ee42.webp" alt="S3配置"></p><p>注意最后一个参数，不是图片后缀名称，而是说<code>S3</code>服务商所支持的图片参数，比如我这里选了文件格式为<code>avif</code>，如果不支持他会自动返回其他格式。</p><p>这样就配置好了，后面你在友圈产生的任何图片，比如分享书籍，电影产生的背景图，分享图片产生的直链都会自动传到存储中，这个图片没有后缀名，不要被误导了。</p><h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p><code>Moments</code>可能功能不是很多，但是非常适合我个人，我也希望作者赶紧修好B站的上传，这玩意可是刚需呜呜呜。</p><p>界面上足够简单，占用比<code>Memos</code>还低，仅仅十几MB的存储，几乎所有服务器都能无负担的部署成功，使用<code>SQLite</code>存储也很好迁移，作者非常好，让大家提意见，他一点点实现，我认为这才是开源社区应该有的模样，而不是这个版本还没完善，就破坏性更新下一版本，同时会自动修改数据库格式，如果错误更新不允许回退，我个人认为这个<strong>领域霸主</strong>似乎有点<del>德不配位</del>，当然我可能并没有资格去评判，Time will tell, the audience will show.</p><p>我个人是偏向于不断的更新，跟上作者的更新步伐，体验最新的功能，很乐意给予反馈和贡献，我也希望可以给开源项目作者提供一定的帮助，但是如果每次更新都需要花大量的时间阅读文档重新适配<code>API</code>等各种东西，在精力上可能稍微有点接受不了。当然可能是我个人要求太多，能力较低，无法正确适配<code>API</code>，<code>Memos</code>抛开<code>API</code>不谈，用起来还是很舒服的，功能强大，同时功能也很完善，是付费产品<code>flomo</code>的完美自托管替代品，希望作者越做越好！</p><h2 id="参考链接"><a href="#参考链接" class="headerlink" title="参考链接"></a>参考链接</h2><div class="liushen-tag-link"><a class="tag-Link" target="_blank" href="/safego/?u=aHR0cHM6Ly9kb2NzLndhZi1jZS5jaGFpdGluLmNuL3poLyVFNSVCOCVCOCVFOCVBNyU4MSVFOSU5NyVBRSVFOSVBMiU5OCVFNiU4RSU5MiVFNiU5RiVBNSMlRTglODclQUElRTUlQUUlOUElRTQlQjklODklRTclQUIlOTklRTclODIlQjktbmdpbngtY29uZg" rel="external nofollow noopener noreferrer"><div class="tag-link-tips">🙄引用站外地址，不保证站点的可用性和安全性</div><div class="tag-link-bottom"><div class="tag-link-left" style="background-image:url(https://p.liiiu.cn/i/2024/07/27/66a4632bbf06e.webp)"></div><div class="tag-link-right"><div class="tag-link-title">自定义站点nginx-conf</div><div class="tag-link-sitename">SafeLine-雷池-不让黑客越过半步</div></div><i class="fa-solid fa-angle-right"></i></div></a></div><div class="liushen-tag-link"><a class="tag-Link" target="_blank" href="/safego/?u=aHR0cHM6Ly9kb2NzLmJpdGlmdWwuY29tL2NvcmVpeC9mZWF0dXJlcy9xdWFsaXR5" rel="external nofollow noopener noreferrer"><div class="tag-link-tips">🙄引用站外地址，不保证站点的可用性和安全性</div><div class="tag-link-bottom"><div class="tag-link-left" style="background-image:url(https://p.liiiu.cn/i/2024/07/27/66a4632bbf06e.webp)"></div><div class="tag-link-right"><div class="tag-link-title">缤纷云OSS质量变换</div><div class="tag-link-sitename">质量变换可以对处理后的图片输出时做质量压缩，以尽可能节省传输流量。</div></div><i class="fa-solid fa-angle-right"></i></div></a></div><div class="liushen-tag-link"><a class="tag-Link" target="_blank" href="/safego/?u=aHR0cHM6Ly90YWxlbi50b3AvL3Bvc3RzLzgzM2ZjYWJiLw" rel="external nofollow noopener noreferrer"><div class="tag-link-tips">🙄引用站外地址，不保证站点的可用性和安全性</div><div class="tag-link-bottom"><div class="tag-link-left" style="background-image:url(https://p.liiiu.cn/i/2024/07/27/66a4632bbf06e.webp)"></div><div class="tag-link-right"><div class="tag-link-title">让Meting API解锁音乐开发新可能</div><div class="tag-link-sitename">爱吃猫的鱼BLOG</div></div><i class="fa-solid fa-angle-right"></i></div></a></div><div class="liushen-tag-link"><a class="tag-Link" target="_blank" href="/safego/?u=aHR0cHM6Ly9ibG9nLmhlc2l5LmNuL3Bvc3RzL3dhZi1pbnN0YWxsLw" rel="external nofollow noopener noreferrer"><div class="tag-link-tips">🙄引用站外地址，不保证站点的可用性和安全性</div><div class="tag-link-bottom"><div class="tag-link-left" style="background-image:url(https://p.liiiu.cn/i/2024/07/27/66a4632bbf06e.webp)"></div><div class="tag-link-right"><div class="tag-link-title">雷池WAF社区版安装+Nginx配置修改指南</div><div class="tag-link-sitename">FloatSheep’s Blog</div></div><i class="fa-solid fa-angle-right"></i></div></a></div><h2 id="每日一图"><a href="#每日一图" class="headerlink" title="每日一图"></a>每日一图</h2><p>图片来自<a target="_blank" rel="external nofollow noopener noreferrer" href="/safego/?u=aHR0cHM6Ly9oYW93YWxscGFwZXIuY29tL2hvbWVWaWV3TG9vay8xNjM2MDQ3NTExNTExMzg1Ng">哲风壁纸</a></p><p><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/02/18/67b459de636a6.webp" alt="小爷是魔，那又如何"></p></article><div class="post-copyright"><div class="post-copyright__title"><span class="post-copyright-info"><h>从Memos转移到Moments</h></span></div><div class="post-copyright__type"><span class="post-copyright-info"><a href="https://blog.liushen.fun/posts/8338183a/">https://blog.liushen.fun/posts/8338183a/</a></span></div><div class="post-copyright-m"><div class="post-copyright-m-info" style="position:relative;z-index:3"><div class="post-copyright-a" style="display:inline-block;width:fit-content;margin:20px 20px 20px 0"><h>作者</h><div class="post-copyright-cc-info"><h>LiuShen</h></div></div><div class="post-copyright-c" style="display:inline-block;width:fit-content;margin:20px 20px 20px 0"><h>发布于</h><div class="post-copyright-cc-info"><h>2025-02-18</h></div></div><div class="post-copyright-u" style="display:inline-block;width:fit-content;margin:20px 20px 20px 0"><h>更新于</h><div class="post-copyright-cc-info"><h>2025-03-20</h></div></div><div class="post-copyright-c" style="display:inline-block;width:fit-content;margin:20px 20px 20px 0"><h>许可协议</h><div class="post-copyright-cc-info"><a rel="noopener" target="_blank" title=" CC BY 4.0" href="https://creativecommons.org/licenses/by-nc-sa/4.0/?ref=chooser-v1">CC BY-NC-SA 4.0</a></div></div></div></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/%E8%AF%B4%E8%AF%B4/">说说</a><a class="post-meta__tags" href="/tags/Memos/">Memos</a><a class="post-meta__tags" href="/tags/Moments/">Moments</a><a class="post-meta__tags" href="/tags/Butterfly/">Butterfly</a></div><div class="post-share"><div class="social-share" data-image="https://p.liiiu.cn/i/2025/02/18/67b40d14e9390.webp" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://jsd.liiiu.cn/npm/butterfly-extsrc@1.1.4/sharejs/dist/css/share.min.css" media="print" onload='this.media="all"'><script src="https://jsd.liiiu.cn/npm/butterfly-extsrc@1.1.4/sharejs/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i>来😍鼠标过来一点~</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="/config/img/wechat.png" target="_blank"><img class="post-qr-code-img" src="" data-lazy-src="/config/img/wechat.png" alt="微信"></a><div class="post-qr-code-desc">微信</div></li><li class="reward-item"><a href="/config/img/wechat.png" target="_blank"><img class="post-qr-code-img" src="" data-lazy-src="/config/img/wechat.png" alt="支付宝"></a><div class="post-qr-code-desc">支付宝</div></li></ul></div></div><nav class="pagination-post" id="pagination"><a class="prev-post pull-left" href="/posts/f9a31276/" title="windows本地部署DeepSeek-R1模型"><img class="cover" src="" data-lazy-src="https://p.liiiu.cn/i/2025/02/08/67a632b06710b.webp" onerror='onerror=null,src="/img/404.jpg"' alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">windows本地部署DeepSeek-R1模型</div></div></a><a class="next-post pull-right" href="/posts/260f4f9a/" title="静态网站优化方案"><img class="cover" src="" data-lazy-src="https://p.liiiu.cn/i/2025/02/26/67becab466c8a.webp" onerror='onerror=null,src="/img/404.jpg"' alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">静态网站优化方案</div></div></a></nav><hr class="custom-hr"><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i> <span>评论</span></div></div><div class="comment-wrap"><div><div id="artalk-wrap"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info is-center"><div class="author-info-detail"><p class="author-info-hello">👋 欢迎光临！</p><p class="author-info-desc">你们好呀！我是站长LiuShen！一个快乐，积极，热爱生活的孩纸！😜😜😜</p></div><div class="avatar-img"><img class="mood-icon" src="" data-lazy-src="https://p.liiiu.cn/i/2025/03/14/67d301461a24a.webp" alt="🤤" onerror='this.onerror=null,this.src="/img/friend_404.gif"'><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/03/13/67d2fc82d329c.webp" onerror='this.onerror=null,this.src="/img/friend_404.gif"' alt="avatar"></div><div class="author-info-name">LiuShen</div><div class="site-data"><a href="/archives/"><div class="headline">文章</div><div class="length-num">72</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">98</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">3</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/willow-god"><i class="fab fa-github"></i><span>Follow Me 🛫</span></a><div class="card-info-social-icons"><a class="social-icon" href="mailto:01@liushen.fun" target="_blank" title="Email"><i class="fa-solid fa-envelope"></i></a><a class="social-icon" href="http://wpa.qq.com/msgrd?v=3&amp;uin=3162475700&amp;site=qq&amp;menu=yes" target="_blank" title="QQ：3162475700"><i class="fa-brands fa-qq"></i></a><a class="social-icon" href="https://wakatime.com/@LiuShen" target="_blank" title="Wakatime"><i class="fa-solid fa-chart-column"></i></a><a class="social-icon" href="https://blog.liushen.fun/atom.xml" target="_blank" title="rss地址"><i class="fa-solid fa-rss"></i></a></div></div><div class="card-widget" id="card-poem"><div id="poem_sentence"></div><div id="poem_info"><div id="poem_dynasty"></div><div id="poem_author"></div></div></div><script src="/js/jinrishici.js" charset="utf-8"></script><script>jinrishici.load((function(e){var n=document.querySelector("#poem_sentence"),t=document.querySelector("#poem_author"),o=document.querySelector("#poem_dynasty"),r=e.data.content;r=r.substr(0,r.length-1),n.innerHTML=r,o.innerHTML=e.data.origin.dynasty,t.innerHTML=e.data.origin.author+"《"+e.data.origin.title+"》"}))</script><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content"><p><strong>博客架构概览：</strong><br>⚙️框架核心：Hexo<br>🕹️界面设计：Butterfly<br>🔮安全保障：长亭雷池<br>🔩管理工具：宝塔面板，1Panel<br>🎰服务器支持：阿里云，腾讯云<br>🎲CDN加速：多吉云，CloudFlare<br><strong>快捷跳转地址：</strong><br>🧩个人相册：<a target="_blank" rel="noopener" href="https://xc.liushen.fun">xc.liushen.fun</a><br>🤖个人导航：<a target="_blank" rel="noopener" href="https://www.liushen.fun">www.liushen.fun</a><br></p><img src="" data-lazy-src="/config/img/notice.gif" alt="可爱捏" title="可爱捏" style="width:100%;border-radius:10px"></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E7%A2%8E%E7%A2%8E%E5%BF%B5"><span class="toc-text">碎碎念</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%89%8D%E6%9C%9F%E8%A6%81%E6%B1%82"><span class="toc-text">前期要求</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%A1%AC%E4%BB%B6%E8%A6%81%E6%B1%82"><span class="toc-text">硬件要求</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%BD%AF%E4%BB%B6%E8%A6%81%E6%B1%82"><span class="toc-text">软件要求</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BB%8B%E7%BB%8D%E4%B8%8E%E5%B1%95%E7%A4%BA"><span class="toc-text">介绍与展示</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%83%A8%E7%BD%B2%E6%95%99%E7%A8%8B"><span class="toc-text">部署教程</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Moments%E9%83%A8%E7%BD%B2"><span class="toc-text">Moments部署</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#Compose%E9%83%A8%E7%BD%B2"><span class="toc-text">Compose部署</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#Nginx%E4%BF%AE%E6%94%B9"><span class="toc-text">Nginx修改</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%89%8D%E7%AB%AF%E5%AE%9E%E7%8E%B0"><span class="toc-text">前端实现</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%AF%B4%E8%AF%B4%E9%A1%B5%E9%9D%A2"><span class="toc-text">说说页面</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E9%A6%96%E9%A1%B5%E8%BD%AE%E6%92%AD"><span class="toc-text">首页轮播</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E9%A2%9D%E5%A4%96%E6%95%99%E7%A8%8B"><span class="toc-text">额外教程</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Meting"><span class="toc-text">Meting</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#S3%E9%85%8D%E7%BD%AE"><span class="toc-text">S3配置</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%80%BB%E7%BB%93"><span class="toc-text">总结</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%8F%82%E8%80%83%E9%93%BE%E6%8E%A5"><span class="toc-text">参考链接</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%AF%8F%E6%97%A5%E4%B8%80%E5%9B%BE"><span class="toc-text">每日一图</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/7915ee6b/" title="数据库可视化WEB工具对比"><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/05/25/6832cc105bc41.webp" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="数据库可视化WEB工具对比"></a><div class="content"><a class="title" href="/posts/7915ee6b/" title="数据库可视化WEB工具对比">数据库可视化WEB工具对比</a><time datetime="2025-05-25T10:01:21.000Z" title="更新于 2025-05-25 18:01:21">2025-05-25</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/40702a0d/" title="本地实现HEXO文章AI摘要"><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/05/06/6819cd4532457.webp" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="本地实现HEXO文章AI摘要"></a><div class="content"><a class="title" href="/posts/40702a0d/" title="本地实现HEXO文章AI摘要">本地实现HEXO文章AI摘要</a><time datetime="2025-05-06T16:01:21.000Z" title="更新于 2025-05-07 00:01:21">2025-05-07</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/5f71a4b1/" title="耗子面板和DPanel简单体验"><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/04/27/680dc7916ef34.webp" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="耗子面板和DPanel简单体验"></a><div class="content"><a class="title" href="/posts/5f71a4b1/" title="耗子面板和DPanel简单体验">耗子面板和DPanel简单体验</a><time datetime="2025-04-28T14:48:21.000Z" title="更新于 2025-04-28 22:48:21">2025-04-28</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/caee2d9f/" title="美化你的RSS订阅地址"><img src="" data-lazy-src="https://p.liiiu.cn/i/2025/04/18/68024a618942b.webp" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="美化你的RSS订阅地址"></a><div class="content"><a class="title" href="/posts/caee2d9f/" title="美化你的RSS订阅地址">美化你的RSS订阅地址</a><time datetime="2025-04-18T12:48:21.000Z" title="更新于 2025-04-18 20:48:21">2025-04-18</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap" style="background:0 0"><div id="footer_icons"><div><a class="icon_link" rel="noopener external nofollow" href="https://www.liushen.fun/" title="导航站点" target="_blank"><i class="fa-solid fa-compass"></i></a><a class="icon_link" rel="noopener external nofollow" href="https://admin.qidian.qq.com/static_proxy/b2b-qq/wpa-link/index.html#/person?uin=3162475700" title="联系QQ" target="_blank"><i class="fa-brands fa-qq"></i></a><a class="icon_link" rel="noopener external nofollow" href="https://github.com/willow-god" title="我的github主页" target="_blank"><i class="fa-brands fa-github"></i></a><a class="icon_link" rel="noopener external nofollow" href="mailto:01@liushen.fun" title="发送邮件至博主邮箱" target="_blank"><i class="fa-solid fa-envelope"></i></a></div><div class="footer_logo_container" onclick="btf.scrollToDest(0,500)" title="返回顶部"><img class="footer_logo" src="" data-lazy-src="/img/footer.gif"></div><div><a class="icon_link" rel="noopener external nofollow" href="https://wakatime.com/@LiuShen" title="Wikitime" target="_blank"><i class="fa-solid fa-clock"></i></a><a class="icon_link" rel="noopener external nofollow" href="https://gitlab.com/" title="gitlab" target="_blank"><i class="fa-brands fa-gitlab"></i></a><a class="icon_link" href="/shuoshuo/" title="日常说说" data-pjax-state="data-pjax-state"><i class="fa-solid fa-file-pen"></i></a><a class="icon_link" href="/comment/" title="留言板" data-pjax-state="data-pjax-state"><i class="fa-solid fa-comment"></i></a></div></div><div id="footer_content"><div class="footer-group"><h3 class="footer-title">关于本站</h3><div class="footer-links"><a class="footer-item" target="_blank" href="https://www.liushen.fun/">导航站点</a><a class="footer-item" href="/shuoshuo/">日常说说</a><a class="footer-item" target="_blank" href="https://um.liushen.fun/share/bIEnQp0xnMxD8c9V/blog.liushen.fun">访客信息</a><a class="footer-item" target="_blank" href="https://mm.liushen.fun/">提笔摘星</a><a class="footer-item" target="_blank" href="https://status.liushen.fun/">在线状态</a><a class="footer-item" href="/subscribe/">订阅本站</a></div></div><div class="footer-group"><h3 class="footer-title">加入组织</h3><div class="footer-links"><a class="footer-item" target="_blank" href="https://www.boyouquan.com/home">博友圈</a><a class="footer-item" target="_blank" href="https://github.com/timqian/chinese-independent-blogs">中博列表</a><a class="footer-item" target="_blank" href="https://blogwe.com/">博客我们</a><a class="footer-item" target="_blank" href="https://storeweb.cn/">个性商店</a><a class="footer-item" target="_blank" href="https://bf.zzxworld.com/">发现博客</a><a class="footer-item" target="_blank" href="https://ourblo.gs/">OurBlogs</a></div></div><div class="footer-group"><h3 class="footer-title">文章整理</h3><div class="footer-links"><a class="footer-item" href="/categories/website/">博客管理</a><a class="footer-item" href="/categories/learning/">学习资料</a><a class="footer-item" href="/categories/daily-share/">日常分享</a><a class="footer-item" href="/archives/">时光卷轴</a><a class="footer-item" href="/charts/">文章通览</a><a class="footer-item" href="/categories/">查看全部</a></div></div><div class="footer-group"><h3 class="footer-title">文章标签</h3><div class="footer-links"><a class="footer-item" href="/tags/JavaScript/">JS知识</a><a class="footer-item" href="/tags/Hexo/">本站框架</a><a class="footer-item" href="/tags/机器学习/">机器学习</a><a class="footer-item" href="/tags/日记/">个人日记</a><a class="footer-item" href="/tags/CSS/">CSS知识</a><a class="footer-item" href="/tags/">查看全部</a></div></div><div class="footer-group"><h3 class="footer-title">自建工具</h3><div class="footer-links"><a class="footer-item" target="_blank" rel="noopener" href="https://chat.liushen.fun/">清羽AI</a><a class="footer-item" target="_blank" rel="noopener" href="https://hot.liushen.fun/">今日热榜</a><a class="footer-item" target="_blank" rel="noopener" href="https://cover.qyliu.top/">封面设计</a><a class="footer-item" target="_blank" rel="noopener" href="https://icon.qyliu.top/">万变图标</a><a class="footer-item" target="_blank" rel="noopener" href="https://tmail.qyliu.top/">临时邮箱</a><a class="footer-item" target="_blank" rel="noopener" href="https://share.liushen.fun/">内容中转</a></div></div><div class="footer-group" id="friend-links-in-footer"><h3 class="footer-title">友链<button title="换一批" href="javascript:;" onclick="liushen.randomLink()"><i class="fa-solid fa-rotate-right"></i></button></h3><div class="footer-links"><a class="footer-item" target="_blank" href="https://blog.liushen.fun">测试1</a><a class="footer-item" target="_blank" href="https://blog.liushen.fun">测试2</a><a class="footer-item" target="_blank" href="https://blog.liushen.fun">测试3</a><a class="footer-item" target="_blank" href="https://blog.liushen.fun">测试4</a><a class="footer-item" target="_blank" href="https://blog.liushen.fun">测试5</a><a class="footer-item" href="/link/" data-pjax-state="data-pjax-state">查看更多</a></div></div></div><div id="footer-bottom"><div class="footer-bottom-content"><div class="footer-bottom-left"><span class="copyright">©2021 - 2025 By <a target="_blank" rel="noopener" href="https://blog.liushen.fun/about/" title="点击访问&quot;LiuShen&quot;的主页" style="margin-left:5px">LiuShen</a></span><div><a class="footer-bottom-link" target="_blank" href="https://beian.miit.gov.cn/" rel="noopener external nofollow" title="工信部备案号">陕ICP备2024028531号-2</a><a class="footer-bottom-link" target="_blank" href="https://beian.mps.gov.cn/#/query/webSearch?code=61011602000637" rel="noopener external nofollow" title="公安备案号">陕公网安备61011602000637号</a></div></div><div class="footer-bottom-right"><div id="runtime" title="本站运行时间">本站已苟活：0 天 0 时 0 分 0 秒</div><div><a class="footer-bottom-link" target="_blank" href="https://www.dogecloud.com/?iuid=9173" rel="noopener external nofollow" title="本站通过多吉云CDN提供站点加速">多吉云CDN</a><a class="footer-bottom-link" target="_blank" href="https://hexo.io/zh-cn/" rel="noopener external nofollow" title="本站使用Hexo架构搭建而成">Hexo静态框架</a><a class="footer-bottom-link" target="_blank" href="https://butterfly.js.org/" rel="noopener external nofollow" title="本站主题由Butterfly主题魔改而成">LiuShen主题</a></div></div></div></div></div><script>window.liushen||(window.liushen={saveData:(e,n)=>{localStorage.setItem(e,JSON.stringify({time:Date.now(),data:n}))},loadData:(e,n)=>{let t=JSON.parse(localStorage.getItem(e));if(t){let e=Date.now()-t.time;if(e>=0&&e<6e4*n)return t.data}return null},runtime:()=>{const e=e=>e>9?e:"0"+e,n=new Date("2021/12/12 01:27:36").getTime(),t=Date.now();let i=Math.round((t-n)/1e3),o="本站已苟活：";i>=86400&&(o+=`${e(Math.floor(i/86400))} 天 `,i%=86400),i>=3600&&(o+=`${e(Math.floor(i/3600))} 时 `,i%=3600),i>=60&&(o+=`${e(Math.floor(i/60))} 分 `,i%=60),o+=`${e(i)} 秒`;const l=document.getElementById("runtime");l&&(l.innerHTML=o),setTimeout(window.liushen.runtime,1e3)},randomLink:()=>{let e=window.liushen.loadData("links",30);if(e){let n=document.querySelectorAll("#friend-links-in-footer .footer-item");if(!n.length)return;for(let t=0;t<n.length;t++){let i=Math.floor(Math.random()*e.length);n[t].innerText=e[i].name,n[t].href=e[i].link,e.splice(i,1)}}else fetch("/flink_count.json").then((e=>e.json())).then((e=>{window.liushen.saveData("links",e.link_list),window.liushen.randomLink()}))}}),window.liushen.randomLink(),document.addEventListener("DOMContentLoaded",window.liushen.randomLink),window.liushen.runtime()</script></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="translateLink" type="button" title="简繁转换" style="width:35px">繁</button><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i><span class="rightside-text">阅读模式</span></button><button id="darkmode" type="button" title="日间和夜间模式切换"><i class="fa-regular fa-star-half-stroke"></i><span class="rightside-text">亮暗切换</span></button><button id="cat" onclick="toggleLive2dVisibility()" title="小猫显隐"><i class="fa-solid fa-cat"></i><span class="rightside-text">小猫显隐</span></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fa-solid fa-arrows-left-right-to-line"></i><span class="rightside-text">侧栏显隐</span></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i><span class="rightside-text">更多设置</span></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i><span class="rightside-text">显示目录</span></button><button id="fullscreen" onclick="toggleFullScreen()" title="全屏切换"><i class="fa-solid fa-expand"></i><span class="rightside-text">全屏切换</span></button><a id="to_comment" href="#post-comment" title="前往评论"><i class="fas fa-comments"></i><span class="rightside-text">快速评论</span></a><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i><span class="rightside-text">回到顶部</span></button></div></div><div id="rightMenu"><div class="rightMenu-group rightMenu-small"><div class="rightMenu-item" id="menu-backward"><i class="fa-solid fa-arrow-left"></i></div><div class="rightMenu-item" id="menu-forward"><i class="fa-solid fa-arrow-right"></i></div><div class="rightMenu-item" id="menu-refresh"><i class="fa-solid fa-arrow-rotate-right"></i></div><div class="rightMenu-item" id="menu-home"><i class="fa-solid fa-house"></i></div></div><div class="rightMenu-group rightMenu-line hide" id="menu-text"><a class="rightMenu-item" id="copy" href="javascript:rm.copySelect();"><i class="fa-solid fa-copy"></i><span>复制选中文字</span></a><a class="rightMenu-item" id="reply" href="javascript:rm.replySelect();"><i class="fa-regular fa-comment"></i><span>评论选中段落</span></a></div><div class="rightMenu-group rightMenu-line rightMenuOther"><a class="rightMenu-item menu-link" href="/archives/"><i class="fa-solid fa-archive"></i><span>文章时间线</span></a><a class="rightMenu-item menu-link" href="/categories/"><i class="fa-solid fa-folder-open"></i><span>文章分大类</span></a><a class="rightMenu-item menu-link" href="/tags/"><i class="fa-solid fa-tags"></i><span>文章小标签</span></a></div><div class="rightMenu-group rightMenu-line rightMenuNormal"><a class="rightMenu-item menu-link" id="menu-radompage" href="/comment/"><i class="fa-solid fa-shoe-prints"></i><span>随心留言板</span></a><div class="rightMenu-item" id="menu-translate"><i class="fa-solid fa-earth-asia"></i><span>繁简模式切换</span></div><div class="rightMenu-item" id="menu-live2dvisibility"><i class="fa-solid fa-cat"></i><span>小猫显示隐藏</span></div><div class="rightMenu-item" id="menu-print"><i class="fa-solid fa-print fa-fw"></i><span>打印整个页面</span></div><a class="rightMenu-item menu-link" id="statement" href="/statement/"><i class="fa-regular fa-copyright fa-fw"></i><span>网站声明</span></a></div></div><div id="rightmenu-mask"></div><div><script src="/js/others.js?v=5.0.0"></script><script src="/js/utils.js?v=5.0.0"></script><script src="/js/main.js?v=5.0.0"></script><script src="https://jsd.liiiu.cn/npm/echarts@5.5.1/dist/echarts.simple.min.js"></script><script src="/js/rightmenu.js?v=5.0.0"></script><script src="/js/jinrishici.js"></script><script src="/js/tw_cn.js?v=5.0.0"></script><script src="https://jsd.liiiu.cn/npm/@fancyapps/ui@5.0.36/dist/fancybox/fancybox.umd.min.js"></script><script src="https://jsd.liiiu.cn/npm/instant.page@5.2.0/instantpage.min.js" type="module"></script><script src="https://jsd.liiiu.cn/npm/vanilla-lazyload@19.1.3/dist/lazyload.iife.min.js"></script><div class="js-pjax"><script>(()=>{let t=null;const e=null,o="shuoshuo"===GLOBAL_CONFIG_SITE.pageType,a=()=>{t&&(t.destroy(),t=null)},n=e=>t&&t.setDarkMode("dark"===e),l=(l=document,i=location.pathname)=>{t=Artalk.init({el:l.querySelector("#artalk-wrap"),server:"https://atk.liushen.fun",site:"清羽飞扬",darkMode:"dark"===document.documentElement.getAttribute("data-theme"),...e,pageKey:i,imgUploader:function(t){let e="Bearer 28|q18njD3pLtHiFy9WidqQrREwqZzb8Zionr8WzilI",o="https://www.baiwulin.work/api/v1/upload",a=new Headers;a.set("Accept","application/json"),a.set("Authorization",e);let n=new FormData;n.append("file",t);const l=(t,e,o)=>fetch(t,{method:"POST",body:e,headers:o}).then((t=>t.json())).then((t=>t.data.links.url)).catch((t=>(console.error("Image upload failed:",t),null)));return l(o,n,a).then((t=>t||(console.warn("雾林图床接口失败，尝试替换为秋叶图床"),e="Bearer 11|lsReISlSS0dyhDzt35ovtfYefGbWSRW2vvntPXs7",o="https://imgse.koxiuqiu.cc/api/v1/upload",a.set("Authorization",e),l(o,n,a))))}}),"null"!==GLOBAL_CONFIG.lightbox&&(t.on("list-loaded",(()=>{t.ctx.get("list").getCommentNodes().forEach((t=>{const e=t.getRender().$content;btf.loadLightbox(e.querySelectorAll("img:not([atk-emoticon])"))}))})),o&&(window.shuoshuoComment.destroyArtalk=()=>{a(),l.children.length&&(l.innerHTML="",l.classList.add("no-comment"))}),btf.addGlobalFn("pjaxSendOnce",a,"destroyArtalk"),btf.addGlobalFn("themeChange",n,"artalk"))},i=async(t,e)=>{"object"==typeof Artalk||(await btf.getCSS("https://jsd.liiiu.cn/npm/artalk@2.9.1/dist/Artalk.min.css"),await btf.getScript("https://jsd.liiiu.cn/npm/artalk@2.9.1/dist/Artalk.min.js")),l(t,e)};o?window.shuoshuoComment={loadComment:i}:setTimeout(i,0)})()</script></div><script>window.newestComments={changeContent:e=>(""===e||(e=(e=(e=(e=(e=e.replace(/<img.*?src="(.*?)"?[^\>]+>/gi,"[图片]")).replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi,"[链接]")).replace(/<pre><code>.*?<\/pre>/gi,"[代码]")).replace(/<code>.*?<\/code>/gi,"[代码]")).replace(/<[^>]+>/g,"")).length>150&&(e=e.substring(0,150)+"..."),e),generateHtml:(e,t)=>{let n="";if(e.length)for(let t=0;t<e.length;t++){if(n+='<div class="aside-list-item">',e[t].avatar){const a="data-lazy-src";n+=`<a href="${e[t].url}" class="thumbnail"><img ${a}="${e[t].avatar}" alt="${e[t].nick}"></a>`}n+=`<div class="content">\n        <a class="comment" href="${e[t].url}" title="${e[t].content}">${e[t].content}</a>\n        <div class="name"><span>${e[t].nick} / </span><time datetime="${e[t].date}">${btf.diffDate(e[t].date,!0)}</time></div>\n        </div></div>`}else n+="暂无评论";t.innerHTML=n,window.lazyLoadInstance&&window.lazyLoadInstance.update(),window.pjax&&window.pjax.refresh(t)},newestCommentInit:(e,t)=>{const n=document.querySelector("#card-newest-comments .aside-list");if(n){const a=btf.saveToLocal.get(e);a?newestComments.generateHtml(JSON.parse(a),n):t(n)}},run:(e,t)=>{newestComments.newestCommentInit(e,t),btf.addGlobalFn("pjaxComplete",(()=>newestComments.newestCommentInit(e,t)),e)}}</script><script>window.addEventListener("load",(()=>{const t="artalk-newest-comments",{changeContent:a,generateHtml:e,run:n}=window.newestComments,r=new URLSearchParams({site_name:"清羽飞扬",limit:"5"});n(t,(async n=>{try{const s=await fetch(`https://atk.liushen.fun/api/v2/stats/latest_comments?${r}`),o=await s.json(),{avatarCdn:c,avatarDefault:i}=await(async()=>{const t=t=>t.startsWith("d=")?t:`d=${t}`;try{const a=await fetch("https://atk.liushen.fun/api/v2/conf"),e=await a.json(),{mirror:n,params:r,default:s}=e.frontend_conf.gravatar;return{avatarCdn:n,avatarDefault:t(r||s)}}catch(a){return console.error(a),{avatarCdn:"",avatarDefault:t("")}}})(),l=o.data.map((t=>({avatar:c&&t.email_encrypted?`${c}${t.email_encrypted}?${i}`:"",content:a(t.content_marked),nick:t.nick,url:t.page_url,date:t.date})));btf.saveToLocal.set(t,JSON.stringify(l),10/1440),e(l,n)}catch(t){console.log(t),n.textContent="无法获取评论，请确认相关配置是否正确"}}))}))</script><script src="/config/memos/memos.js"></script><script id="canvas_nest" defer color="128,128,128" opacity="0.7" zindex="-1" count="99" mobile="false" src="https://jsd.liiiu.cn/npm/butterfly-extsrc@1.1.4/dist/canvas-nest.min.js"></script><link rel="stylesheet" href="https://jsd.liiiu.cn/npm/aplayer@1.10.1/dist/APlayer.min.css" media="print" onload='this.media="all"'><script src="https://jsd.liiiu.cn/npm/aplayer@1.10.1/dist/APlayer.min.js"></script><script src="https://jsd.liiiu.cn/npm/meting@2.0.1/dist/Meting.min.js"></script><script src="https://jsd.liiiu.cn/npm/pjax@0.2.8/pjax.min.js"></script><script>(()=>{window.pjax=new Pjax({elements:'a:not([target="_blank"])',selectors:["head > title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax"],cacheBust:!1,analytics:!1,scrollRestoration:!1});const e=e=>{e&&Object.values(e).forEach((e=>e()))};document.addEventListener("pjax:send",(()=>{btf.removeGlobalFnEvent("pjaxSendOnce"),btf.removeGlobalFnEvent("themeChange");const t=document.body.classList;t.contains("read-mode")&&t.remove("read-mode"),e(window.globalFn.pjaxSend)})),document.addEventListener("pjax:complete",(()=>{btf.removeGlobalFnEvent("pjaxCompleteOnce"),document.querySelectorAll("script[data-pjax]").forEach((e=>{const t=document.createElement("script"),n=e.text||e.textContent||e.innerHTML||"";Array.from(e.attributes).forEach((e=>t.setAttribute(e.name,e.value))),t.appendChild(document.createTextNode(n)),e.parentNode.replaceChild(t,e)})),e(window.globalFn.pjaxComplete)})),document.addEventListener("pjax:error",(e=>{404===e.request.status&&pjax.loadUrl("/404")}))})()</script><script async data-pjax="" src="/config/busuanzi/busuanzi.js"></script><div id="algolia-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="search-wrap"><div id="algolia-search-input"></div><hr><div id="algolia-search-results"><div id="algolia-hits"></div><div id="algolia-pagination"></div><div id="algolia-info"><div class="algolia-stats"></div><div class="algolia-poweredBy"></div></div></div></div></div><div id="search-mask"></div><script src="https://jsd.liiiu.cn/npm/algoliasearch@5.8.1/dist/lite/builds/browser.umd.min.js"></script><script src="https://jsd.liiiu.cn/npm/instantsearch.js@4.75.0/dist/instantsearch.production.min.js"></script><script src="/js/search/algolia.js?v=5.0.0"></script></div></div><div class="needEndHide" id="nav-music"><div id="nav-music-hoverTips" onclick="liuMusic.musicToggle()">音乐已暂停</div><meting-js id="13597135963" server="netease" type="playlist" mutex="true" preload="none" data-lrctype="0" order="random" volume="0.8" api="https://met.liiiu.cn/meting/api?server=:server&amp;type=:type&amp;id=:id&amp;r=:r"></meting-js></div><script data-pjax="">function butterfly_swiper_injector_config(){var a=document.getElementById("recent-posts");console.log("已挂载butterfly_swiper"),a.insertAdjacentHTML("afterbegin",'<div class="recent-post-item" style="height: auto;width: 100%"><div class="blog-slider swiper-container-fade swiper-container-horizontal" id="swiper_container"><div class="blog-slider__wrp swiper-wrapper" style="transition-duration: 0ms;"><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;posts/4bb33804/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://p.liiiu.cn/i/2025/04/08/67f49876a62e5.webp" alt="" onerror="this.src=/img/error-page.png; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-04-08</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;posts/4bb33804/&quot;);" href="javascript:void(0);" alt="">PaddleYOLO训练自己的数据集</a><div class="blog-slider__text">近期一直在研究毕业设计，在其中，我涉及到了PaddleYOLO的训练和部署，在网上的教程较少，经过不断努力，我也算是跑出来了，所以在这里分享出来做个记录，防止下次使用又忘记了怎么搞。</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;posts/4bb33804/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;posts/5f71a4b1/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://p.liiiu.cn/i/2025/04/27/680dc7916ef34.webp" alt="" onerror="this.src=/img/error-page.png; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-04-28</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;posts/5f71a4b1/&quot;);" href="javascript:void(0);" alt="">耗子面板和DPanel简单体验</a><div class="blog-slider__text">最近毕业设计临近尾声，代码也敲完了，目前就剩稍微的调优，就可以开始写论文啦！在闲暇时间，我也尝试部署了一些不一样的面板程序，总感觉1panel稍微有些复杂，很多功能并用不上，比如GPU，下面简单分享一下我的体验。</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;posts/5f71a4b1/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;posts/40702a0d/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://p.liiiu.cn/i/2025/05/06/6819cd4532457.webp" alt="" onerror="this.src=/img/error-page.png; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-05-07</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;posts/40702a0d/&quot;);" href="javascript:void(0);" alt="">本地实现HEXO文章AI摘要</a><div class="blog-slider__text">五一假期结束啦！这五天啥也没干，就在宿舍敲代码，都快无聊死了，恰逢找到了一些免费API，就自己实现一个AI摘要吧！利用API生成摘要文本放在文章头部，再通过hexo进行渲染就好啦！</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;posts/40702a0d/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;posts/7915ee6b/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://p.liiiu.cn/i/2025/05/25/6832cc105bc41.webp" alt="" onerror="this.src=/img/error-page.png; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-05-25</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;posts/7915ee6b/&quot;);" href="javascript:void(0);" alt="">数据库可视化WEB工具对比</a><div class="blog-slider__text">最近迁移服务器，并且搞了一个1P专业版玩玩，感觉效果很不错，想找一个管理数据库的服务，其中看了phpmyadmin等一些知名项目，但是都不太符合我的要求，最后经过筛选，找到了比较合适的，分享给大家！</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;posts/7915ee6b/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div><div class="blog-slider__item swiper-slide" style="width: 750px; opacity: 1; transform: translate3d(0px, 0px, 0px); transition-duration: 0ms;"><a class="blog-slider__img" onclick="pjax.loadUrl(&quot;posts/caee2d9f/&quot;);" href="javascript:void(0);" alt=""><img width="48" height="48" src= "" data-lazy-src="https://p.liiiu.cn/i/2025/04/18/68024a618942b.webp" alt="" onerror="this.src=/img/error-page.png; this.onerror = null;"/></a><div class="blog-slider__content"><span class="blog-slider__code">2025-04-18</span><a class="blog-slider__title" onclick="pjax.loadUrl(&quot;posts/caee2d9f/&quot;);" href="javascript:void(0);" alt="">美化你的RSS订阅地址</a><div class="blog-slider__text">近期天天忙着毕业设计，冷落了站点文章的更新，最近也终于算是快要搞完了，于是开始捣鼓一些好玩的东西，在浏览阮一峰大佬的周刊时，了解到了RSS也能美化，折腾了一下，没想到还真实现了，在此分享一下。</div><a class="blog-slider__button" onclick="pjax.loadUrl(&quot;posts/caee2d9f/&quot;);" href="javascript:void(0);" alt="">详情       </a></div></div></div><div class="blog-slider__pagination swiper-pagination-clickable swiper-pagination-bullets"></div></div></div>')}for(var elist="null".split(","),cpage=location.pathname,epage="/",flag=0,i=0;i<elist.length;i++)cpage.includes(elist[i])&&flag++;("all"===epage&&0==flag||epage===cpage)&&butterfly_swiper_injector_config()</script><script defer src="https://jsd.liiiu.cn/npm/swiper@11.1.14/swiper-bundle.min.js"></script><script defer data-pjax="" src="/config/swiper/swiper_init.js"></script><script src="https://jsd.liiiu.cn/npm/live2d-widget@^3.1.3/lib/L2Dwidget.min.js"></script><script>L2Dwidget.init({pluginModelPath:"assets/",model:{scale:1,hHeadPos:.5,vHeadPos:.618,jsonPath:"/live2dw/assets/tororo.model.json"},display:{superSample:2,width:250,height:500,position:"left",hOffset:-20,vOffset:-90},mobile:{show:!1,scale:.5},react:{opacityDefault:.7,opacityOnHover:.2},log:!1,pluginJsPath:"lib/",pluginRootPath:"live2dw/",tagMode:!1})</script></body></html>